Count if multiple criteria are met

Jasesair

Active Member
Joined
Apr 8, 2015
Messages
282
Office Version
  1. 2016
For some unknown reason, I'm struggling to write a formula that counts the number of rows that some criteria are met. I've tried both countif and sumproduct without success. Any ideas?

=COUNTIFS($A:$A,$BK$8,$C:$C,$BL$8,$D:$D,$BM$8,$H:$H,"3")

=SUMPRODUCT(($A:$A=$BK$8)*($C:$C=$BL$8)*($D:$D=$BM$8)*($H:$H="3"))

I must be doing something fundamentally wrong, but I just can't see it!
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try the formula without quotes around 3
 
Upvote 0
What do you get?...an error or 0? Are there rows where you know all of those conditions are met at the same time?
 
Upvote 0
It’s very hard to assess without seeing the range, it’s format and the criteria ranges. It could be one of many things.

However, try taking the 3 out of the double quotations. In general, text values need to be included in quotations unless there’s a logical operator such as “>3”. Since it is just equal to 3, just leave it as 3 without quotes and see if that works first. This is assuming that your count range with 3 inside is formatted as a number value and not a text value.
 
Upvote 0
Maybe this way, but I'd reduce the ranges rather than using entire columns
Excel Formula:
=SUMPRODUCT(($A:$A=$BK$8)+($C:$C=$BL$8)+($D:$D=$BM$8)+($H:$H=3))
 
Upvote 0
It’s very hard to assess without seeing the range, it’s format and the criteria ranges. It could be one of many things.

However, try taking the 3 out of the double quotations. In general, text values need to be included in quotations unless there’s a logical operator such as “>3”. Since it is just equal to 3, just leave it as 3 without quotes and see if that works first. This is assuming that your count range with 3 inside is formatted as a number value and not a text value.
Alternatively, place a helper column in with 1 for every value to the bottom of your data set. Now perform a sumifs on this range with the same criteria.
 
Upvote 0
Apologies everyone. As I was doing up an example, I realised my error. I had a word + number within each cell in one of the columns, rather than simply the number it was trying to find. Bit of a lesson there for rookies!!!
 
Upvote 0
Apologies everyone. As I was doing up an example, I realised my error. I had a word + number within each cell in one of the columns, rather than simply the number it was trying to find. Bit of a lesson there for rookies!!!
It happens to us all at some point!
No worries
 
Upvote 0

Forum statistics

Threads
1,214,985
Messages
6,122,605
Members
449,089
Latest member
Motoracer88

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