Count between a range of times

domdc1

Board Regular
Joined
Apr 10, 2006
Messages
63
Hi there all....
Todays dilema is as follows:
i have various shifts on various cells through out my sheet.

d7 - 15:30
d8 - 06:00
d9 - 10:00

d13 - 07:30
d14 - 06:00
d15 - 08:00

I need to count how many fall within each range that i specify. For example between 06:00 - 08:00 the result should be 4
08:30 - 10:00 the result should be 1 etc

Ive tried to count frequency and countif but i cant seem to pinpoint the query above.
As usual any help is greatly appreciated.
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
You could use two countifs like

=COUNTIF(D1:D100,">=06:00")-COUNTIF(D1:D100,">08:00")

That count includes 06:00 exactly and 08:00 exactly so you'd need to be careful if you also count 08:00 to 10:00 the same way as you'd double count 08:00 shifts. To avoid that possibly make the 2nd countif include =, i.e.

=COUNTIF(D1:D100,">=06:00")-COUNTIF(D1:D100,">=08:00")

That would include exactly 06:00 but not 08:00
 
Upvote 0
hi there i dont think it worked right:

d7 - 15:30 e7 vac
d8 - 06:00 e8 14:00
d9 - 10:00 e9 15:30

d13 - 22:30 e13 6:00
d14 - 07:00 e14 6:30
d15 - vac e15 X

=COUNTIF(D7:D9,">=06:00")-(COUNTIF(D13:D15,">=07:30")) gives me 2
=COUNTIF(E7:E9,">=06:00")-(COUNTIF(E13:E15,">=07:30")) gives me -1 id expect 2 ???

what is wrong ???
thx
 
Upvote 0

Forum statistics

Threads
1,215,514
Messages
6,125,267
Members
449,219
Latest member
daynle

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