# Count between a range of times

#### domdc1

##### Board Regular
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

#### barry houdini

##### MrExcel MVP
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

#### domdc1

##### Board Regular
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

Replies
15
Views
444
Replies
1
Views
1K
Replies
1
Views
213
Replies
1
Views
575
Replies
2
Views
1K

1,191,168
Messages
5,985,054
Members
439,936
Latest member
BSR

### 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.

### Which adblocker are you using?

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

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