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

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

slinky

Active Member
Joined
Dec 19, 2008
Messages
294
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..)
 

studio95

Board Regular
Joined
Aug 13, 2012
Messages
83
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.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,990
Messages
5,856,679
Members
431,828
Latest member
kARTIK12345

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
Top