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

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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,214,911
Messages
6,122,195
Members
449,072
Latest member
DW Draft

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