COUNTIFS formula

johns99

Board Regular
Joined
Jun 11, 2013
Messages
223
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm having issues with a COUNTIFS formula...I'm using the below

=COUNTIFS($CT$6:$CT$7666,"P1",$X$6:$X$7666,{"x","+"})

this returns a result of 166, however when I filter on the above criteria "P1" and {"x","+"} I'm showing 217

Any ideas why this would not be working?

Thanks in advance,

John
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
You are only seeing the count for "x", you need an added SUM function to get the total for "x" and "+"

=SUM(COUNTIFS($CT$6:$CT$7666,"P1",$X$6:$X$7666,{"x","+"}))
 
Upvote 0
It's only counting x's (the first value in the array). You would need to add a third argument so that x and + are separate.
 
Upvote 0
Thank you both for your quick responses!

@barry houdini I've added the SUM and this fixed the problem. Thank you both, have a great weekend!
 
Upvote 0
I do have an additional question that I hope one of you will be able to help me with...

Using the info above...so taking a count of "P1" and {"x","+"}...I am also trying to count information in column W. The issue is there are duplicates in column W that I would not want to include so I can find out how many unique values are in this column.

So I would like to take a count of how many unique values are in column W for people who are labeled with {"x","+"} in column X and "P1" in column CT.

Is this possible?

Let me know if I'm not clear.
 
Upvote 0
That's a bit trickier but you can use an "array formula" like this

=SUM(IF(FREQUENCY(IF($CT$6:$CT$7666="P1",IF(($X$6:$X$7666="x")+($X$6:$X$7666="+"),IF($W$6:$W$7666<>"",MATCH($W$6:$W$7666,$W$6:$W$7666,0)))),ROW($W$6:$W$7666)-ROW($W$6)+1),1))

confirmed with CTRL+SHIFT+ENTER
 
Upvote 0
This worked! Thank you for all your help today, it's much appreciated.

Have a great weekend.

Cheers,

John
 
Upvote 0

Forum statistics

Threads
1,213,492
Messages
6,113,967
Members
448,537
Latest member
Et_Cetera

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top