COUNTIFS (Needing to find value of a range between 1 time and another for a specific date)

gooselfc

New Member
Joined
Sep 8, 2015
Messages
5
I need to calculate the in E2 the value if range A:A is on a specific date (Using D2,D3 and so on), and also if the start time in B is greater than the header and if end time is less than the next time slot, basically count how many times in a 30 min segment would it fill on any specific day in the table from E onwards.
Excel Countif.PNG

So from the data set in the image I would expect for E2 at 07:00 to have "6" (Times on the 17th starting on or before 07:00 counted in the segment) and F2 at 07:30 to have "9" (Times on the 17th starting on or before 07:30 counted in the segment) and so on...
Am I doing something completely wrong or am I missing something
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
What version of Excel are you using?

I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

How about
Excel Formula:
=COUNTIFS($A:$A,$D2,$B:$B,">="&E$1,$C:$C,"<="&F$1)
 
Upvote 0
This should work. I think it is the formatting of your dates.

Book1
ABCDEFGHIJKLMNOPQ
1StartEndDay7:00 AM7:30 AM8:00 AM8:30 AM9:00 AM9:30 AM10:00 AM10:30 AM11:00 AM11:30 AM12:00 PM12:30 PM1:00 PM
210/17/20227:3010/17/20226301112000000
310/17/20229:3010/18/20223210010000000
410/17/20227:30
510/17/20227:00
610/17/20227:00
710/17/202210:00
810/17/20227:30
910/17/202210:00
1010/17/20227:00
1110/17/20228:30
1210/17/20229:00
1310/17/20227:00
1410/17/20227:00
1510/17/20227:00
1610/18/20227:30
1710/18/20229:30
1810/18/20227:30
1910/18/20227:00
2010/18/20228:00
2110/18/20227:00
2210/18/20227:00
Sheet1
Cell Formulas
RangeFormula
F1:Q1F1=E1+TIME(,30,)
E2:Q3E2=COUNTIFS($A:$A,$D2,$B:$B,E$1)
 
Upvote 0

Forum statistics

Threads
1,215,034
Messages
6,122,782
Members
449,095
Latest member
m_smith_solihull

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