KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hello, I'm trying to perform a countifs with multiple criteria but part of the multiple criteria is in the same column and I can't get the countifs to calculate properly.

I am trying to ask, "How many people work on this day of the week at this time?"

One start time and one day of the week I can calculate just fine:
Example:
=COUNTIFS($B$2:$B$5,"MO",$A$2:$A$5,A2)
This formula comes out to 4.

StartWeek
6:30 AMMo
6:30 AMMo
6:30 AMMo
6:30 AMMo

<tbody>
</tbody>


However, if I add an additional day of the week for a criteria, it gives me a zero.
=COUNTIFS($B$2:$B$5,"MO",$B$2:$B$5,"TU",$A$2:$A$5,A2)

I don't get why I'm getting zero. Should be 4.

StartWeek
6:30 AMMo
6:30 AMMo
6:30 AMTu
6:30 AMTu

<tbody>
</tbody>
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
Re: COUNTIFS Help

you would need to configure the countifs to handle an OR criteria....

=SUM(COUNTIFS(B2:B5,{"MO","TU"},A2:A5,A2))

this would give you 2 for MO and 2 for TU and the sum would add them together.
 
Upvote 0
Re: COUNTIFS Help

Thank you. I also just figured this one out after I typed my question

=COUNTIFS($B$2:$B$5,"MO",$A$2:$A$5,A2)+COUNTIFS($B$2:$B$5,"TU",$A$2:$A$5,A2)

But your formula is less bulky.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,215,444
Messages
6,124,891
Members
449,194
Latest member
JayEggleton

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