Countifs

docjackson33

New Member
Joined
Feb 7, 2010
Messages
18
I need to count a list of rank, and using the countifs seemed the proficient way, however I cant get it to work. Here's the formula I currently have, but it keeps returning a zero. I've tried the insert function but to no avail.

=COUNTIFS($E:$E,"PVT",$E:$E, "PV2",$E:$E, "PFC",$E:$E, "SPC",$E:$E, "CPL")

Thanks in advance,

Jonathan
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
This works

=COUNTIF(E:E,"PVT"), one for each variant
 
Upvote 0
Thanks Barry, that's one less advil I'll need to take. Can you explain why the countifs is not working without the sum though?
 
Upvote 0
With COUNTIFS the only rows counted are those that satisfy all the conditions so a formula like this would make sense

=COUNTIFS(A:A,"x",B:B,"y")

that will count rows where column A = "x" and column B = "y" but if you do this

=COUNTIFS(A:A,"x",A:A,"y")

....you'll always get zero because no cell can be "x" and "y"

With the version I suggested you are, in essence, using 5 COUNTIF formulas in one, the result of

=COUNTIF($E:$E,{"PVT","PV2","PFC","SPC","CPL"})

is an array of 5 values, e.g. if there were two PVTs in the range and three each of the rest that would give you this array

{2,3,3,3,3} and the SUM just sums those values to give the total
 
Upvote 0

Forum statistics

Threads
1,223,355
Messages
6,171,614
Members
452,411
Latest member
sprichwort

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