Countif multiple criteria in a table?

Calv1

New Member
Joined
Oct 4, 2013
Messages
15
Office Version
  1. 2013
Platform
  1. Windows
Hi, I have an issue that I've been struggling with and I hope someone could please help me out.

At work we have a standby rota, with one sheet per month. In each sheet there's a rota, and essentially it looks like this (but with each date of the month in it);

FriSatSunMontueWedTotal Days
Employee Name123456
Person1BB2
Person2B1
Person3B1
Person4B1
Person5B1

I've added some index / matches to retrieve the totals of how many days in each month a particular person is on standby, however what I want to do is now get totals of specific dates. So for example how many days person1 has been on standby on a Monday in a given month. I'll then add these together separately for a yearly total.

I can't work out how this would be possible? Some form of index/match/countif array formula ? Arrays are my downfall unfortunately. Any help would be greatly appreciated on this.
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
I should add, I've tried something like this to no avail;

=COUNTIFS(January!A4:AG11,"B",January!B3:AF3,"Mon",January!A5,"Person1")
 
Upvote 0
SumProduct 2020.xlsm
ABCDEFGHIJKAGAH
1FriSatSunMonTueWedThuFriSatSunTotal DaysFri
2Name1234567891031
3Person 1BBB42
4
5b
Cell Formulas
RangeFormula
AG2AG2=COUNT(B2:AF2)
AG3AG3=COUNTA(B3:AF3)
AH3AH3=SUMPRODUCT(--(B3:AF3="B"),--(B1:AF1=AH1))
 
Upvote 0
SumProduct 2020.xlsm
ABCDEFGHIJKAGAH
1FriSatSunMonTueWedThuFriSatSunTotal DaysFri
2Name1234567891031
3Person 1BBB42
4
5b
Cell Formulas
RangeFormula
AG2AG2=COUNT(B2:AF2)
AG3AG3=COUNTA(B3:AF3)
AH3AH3=SUMPRODUCT(--(B3:AF3="B"),--(B1:AF1=AH1))
Dave, thank you very much for the suggestion. This does work in the meantime, however I'd ideally be looking to have this "dynamic" so that I can also add the person name is a parameter.

I'd ideally like to avoid having helper columns on each sheet.

Ultimately I'm adding these totals up on a separate sheet, and being able to sum the whole table at once for "person name", "day" , and "B", would be best as it won't need as much manual intervention with fixed ranges per person.
 
Upvote 0
I should add, I've tried something like this to no avail;

=COUNTIFS(January!A4:AG11,"B",January!B3:AF3,"Mon",January!A5,"Person1")
How about:

Excel Formula:
=SUMPRODUCT((January!B4:AF11="B")*(January!B3:AF3="Mon")*(January!A4:A11="Person1"))
 
Upvote 0
Solution
You can expand the SumProduct formula.

The least resource intensive is the example sown above.

Hard code the relevant columns
=SUMPRODUCT((Data!A3:A100=A5)*(Data!B3:B100="B")+(Data!G3:G100="B"))
 
Upvote 0
You can expand the SumProduct formula.

The least resource intensive is the example sown above.

Hard code the relevant columns
=SUMPRODUCT((Data!A3:A100=A5)*(Data!B3:B100="B")+(Data!G3:G100="B"))
How about:

Excel Formula:
=SUMPRODUCT((January!B4:AF11="B")*(January!B3:AF3="Mon")*(January!A4:A11="Person1"))

Apologies for the delay in getting back to you both on this. But thank you very much for the solutions, they work absolutely perfectly.
 
Upvote 0

Forum statistics

Threads
1,214,936
Messages
6,122,340
Members
449,079
Latest member
rocketslinger

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