Countifs with Multiple Criteria

BillHassall

New Member
Joined
Nov 11, 2009
Messages
42
I am trying to use Countifs to count the same set of cells but with different criteria either by directly inputiing the names that I want to find (H5, H6 and H7, this is text and not cell number) or by reference to the cells that the information is in (cells D1, D2 & D3), so what I want to achieve is one of the following

COUNTIFS(September!$G:$G,{"H5";"H6";"H7"},September!$B:$B,Totals!B$17)

This only gives cells that have H5 in them not H6 or H7

My preferred method would be as follows which doesnt work at all

COUNTIFS(September!$G:$G,D1 or D2 or D3,September!$B:$B,Totals!B$17)

In the second case cells D1,D2 & D3 would contain the text H5, H6 & H7

Thanks

Bill
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Try:
=SUM(COUNTIFS(September!$G:$G,{"H5";"H6";"H7"},September!$B:$B,Totals!B$17))
 
Upvote 0
To use the cell references

=SUMPRODUCT(COUNTIFS(September!$G:$G,D1:D3,September!$B:$B,Totals!B$17))
 
Upvote 0
Excellent, both work a treat, thanks for your help, spent ages trying to find the answer before posting

Bill
 
Upvote 0

Forum statistics

Threads
1,222,032
Messages
6,163,506
Members
451,839
Latest member
HonestZed

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