COUNTIFS Help

KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
Hello,
I am trying to perform a task similar to what a COUNTIFS would do but I can't seem to get it.
Columns A-F are used.

I have agents, a work week (IE F--MTWR), start time and Criteria. # of agents or column D is where the formula is.

Example:
If I want to see how many people have a 6:30 AM shift, that's 7 people below.
But if I want to find the number of agents who work at 6:30 AM and have a F--MTWR schedule (which should be 3) I can't calculate that.

The formula I've tried is the following and it calculates zero:
=COUNTIFS(B2:C8,E2,B2:C8,F2)

[TABLE="width: 594"]
<tbody>[TR]
[TD]Agent[/TD]
[TD]Week[/TD]
[TD]Time[/TD]
[TD]# of Agents[/TD]
[TD]Start Criteria[/TD]
[TD]Week Criteria[/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]F--MTWR[/TD]
[TD]6:30 AM[/TD]
[TD] 7[/TD]
[TD]6:30 AM[/TD]
[TD]F--MTWR[/TD]
[/TR]
[TR]
[TD]Jack[/TD]
[TD]F--MTWR[/TD]
[TD]6:30 AM[/TD]
[TD] 0[/TD]
[TD]6:45 AM[/TD]
[TD]--SMTWR[/TD]
[/TR]
[TR]
[TD]Bill[/TD]
[TD]F--MTWR[/TD]
[TD]6:30 AM[/TD]
[TD][/TD]
[TD]7:00 AM[/TD]
[TD]FY--TWR[/TD]
[/TR]
[TR]
[TD]Sam[/TD]
[TD]FY--TWR[/TD]
[TD]6:30 AM[/TD]
[TD][/TD]
[TD]7:30 AM[/TD]
[TD]-YSMTW-[/TD]
[/TR]
[TR]
[TD]Susan[/TD]
[TD]FYSMT--[/TD]
[TD]6:30 AM[/TD]
[TD][/TD]
[TD]8:00 AM[/TD]
[TD]FYSMT--[/TD]
[/TR]
[TR]
[TD]Karen[/TD]
[TD]FYSM--R[/TD]
[TD]6:30 AM[/TD]
[TD][/TD]
[TD]8:30 AM[/TD]
[TD]FYSM--R[/TD]
[/TR]
[TR]
[TD]Mary[/TD]
[TD]FYS--WR[/TD]
[TD]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D]
[TD][/TD]
[TD]4:00 PM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]5:00 PM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]10:00 PM[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD]10:30 PM[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).
Hi,

I think this is what you mean:


Book1
ABCDEF
1AgentWeekTime# of AgentsStart CriteriaWeek Criteria
2JohnF--MTWR6:30 AM36:30 AMF--MTWR
3JackF--MTWR6:30 AM6:45 AM--SMTWR
4BillF--MTWR6:30 AM7:00 AMFY--TWR
5SamFY--TWR6:30 AM7:30 AM-YSMTW-
6SusanFYSMT--6:30 AM8:00 AMFYSMT--
7KarenFYSM--R6:30 AM8:30 AMFYSM--R
8MaryFYS--WR6:30 AM9:00 AMFYS--WR
Sheet90
Cell Formulas
RangeFormula
D2=COUNTIFS(C$2:C$8,E2,B$2:B$8,F2)
 
Upvote 0
you get error even if you use correct formula???

than you need to consider below points:-

1)Check Time format , is it in Time format>
2)Check whether any extra space in Week value.
try manually do filter check each record whether it's matching to your criteria OR NOT.
 
Upvote 0
That's exactly what I mean. Thank you. I was grouping the range to include both criteria. You represented each criteria in the COUNTIFS function separately (look at the Time column C2:C8 now look at the Week column B2:B8) instead of all at once. Thank you.
 
Upvote 0
You're welcome, glad it works for you.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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