CountIFS

studio95

Board Regular
Joined
Aug 13, 2012
Messages
83
Morning Gents,

I have a sheet with 3 named ranges, I want (on a separate sheet) a cell which counts all occurrences of the word "Bank Holiday" within all three named ranges. I have attempted to use the following:- (AAPR1, AAPR2, AAPR3 are the named ranges)

=COUNTIFS(AAPR1,"Bank Holiday",AAPR2,"Bank Holiday",AAPR3,"Bank Holiday")

There is no error reported when the above is entered but likewise is returning no values. I don't know if it makes any difference but the word "Bank Holiday" is selected from a data validation list, I dont see why it would make a difference as when i just use =COUNTIF(AAPR1,"Bank Holiday") it returns a value.

Thank you for your help.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
I'm only running Excel 2k3 here, so can't validate my thoughts, but IIRC COUNTIFS() doesn't work in that fashion. COUNTIFS() will count within one range against multiple criteria, as opposed to multiple ranges with singular criteria per range.

To achieve the result you need you would need to add multiple COUNTIF() statements together.

=COUNTIF(AAPR1,"Bank Holiday")+COUNTIF(AAPR1=2,"Bank Holiday")+COUNTIF(AAPR3,"Bank Holiday")

(Of course, I could be wrong..)
 
Upvote 0
I'm only running Excel 2k3 here, so can't validate my thoughts, but IIRC COUNTIFS() doesn't work in that fashion. COUNTIFS() will count within one range against multiple criteria, as opposed to multiple ranges with singular criteria per range.

To achieve the result you need you would need to add multiple COUNTIF() statements together.

=COUNTIF(AAPR1,"Bank Holiday")+COUNTIF(AAPR1=2,"Bank Holiday")+COUNTIF(AAPR3,"Bank Holiday")

(Of course, I could be wrong..)

You are far from wrong Slinky, you are spot on other than you had (AAPR1=2) which I just changed to AAPR2! which then worked a treat!

Thank you buddy.
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,999
Members
448,541
Latest member
iparraguirre89

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