Totals based upon multiple criteria (COUNTIF)

snpperhd

New Member
Joined
Oct 5, 2009
Messages
5
Hi, I have a work schedule created in Excel that has various single letter designators for duties performed. X indicates at work, S indicates on Standby, C for Comp Day etc... I currently use a COUNTIF formula to total the "X"s to show total number of people at work; how can I add multiple variables to this formula to total other designators which are also at work like the "S"s for standby? Below is my current formula. Thanks.
=0+(COUNTIF(C10:C27,"X"))

snpperhd
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Hi, I have a work schedule created in Excel that has various single letter designators for duties performed. X indicates at work, S indicates on Standby, C for Comp Day etc... I currently use a COUNTIF formula to total the "X"s to show total number of people at work; how can I add multiple variables to this formula to total other designators which are also at work like the "S"s for standby? Below is my current formula. Thanks.
=0+(COUNTIF(C10:C27,"X"))

snpperhd
Try one of these...

=SUM(COUNTIF(C10:C27,{"X","S"}))

=COUNTIF(C10:C27,"X")+COUNTIF(C10:C27,"S")
 
Upvote 0
Thanks to 'T Valko' & 'njimack' for the quick response...T Valko's =SUM(COUNTIF(C10:C27,{"X","S"})) worked. I tried the two other options, but each didn't quite work. Thanks again.

snpperhd
 
Upvote 0
Thanks to 'T Valko' & 'njimack' for the quick response...T Valko's =SUM(COUNTIF(C10:C27,{"X","S"})) worked. I tried the two other options, but each didn't quite work. Thanks again.

snpperhd
You're welcome. Thanks for the feedback! :cool:
 
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,719
Members
452,939
Latest member
WCrawford

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