counting cells containg date/time

pacoonejr

Board Regular
Joined
Apr 19, 2003
Messages
138
column E is full of dates and times

12/26 06:00
through
12/27 06:00


i need to count everything from 06:00 TO 13:59
from 14:00 to 21:59 AND from 22:00 TO 06:00

the issue is this report is pulled daily
each day the date changes.

so here i am at the house full of smart people begging
thanks in advance......
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
So, are you summarising the Hours for each date/day...etc ?

Sort of a tabulation for each day?

(y)
 
Upvote 0
actually what it is is a count of each row for each shift

every row for each 8 hour time period

if there where 30 rows less than 14:00 then i would need 30

etc etc
 
Upvote 0
I would add an extra column to the sheet, where you calculate which shift the row belongs to. Then use a pivot table to summarise the data.
 
Upvote 0
Are you intending to add the total occurences of each time event, as in 06:00 happened 18 times, or to summarise the total number of hours?

I think maybe a little more detail is required... I suspect.


(y)

pacoonejr said:
I am so confused :rolleyes:
 
Upvote 0
For a formula solution, you could use
=SUMPRODUCT((HOUR($A$1:$A$10)>=6)*(HOUR($A$1:$A$10)<14))
and a similar formula for 14-22 shift. With passing midnight on your other shift, try
=SUMPRODUCT(((HOUR($A$1:$A$10)>=22)+(HOUR($A$1:$A$10)<6))*($A$1:$A$10<>0))

where the last argument will not falsely count blank cells.
 
Upvote 0
pacoonejr said:
column E is full of dates and times

12/26 06:00
through
12/27 06:00

i need to count everything from 06:00 TO 13:59
from 14:00 to 21:59 AND from 22:00 TO 06:00

the issue is this report is pulled daily
each day the date changes.

so here i am at the house full of smart people begging
thanks in advance......
Hi pac:

If I have understood you correctly, try this ...
Book2
DEFGHI
1DateAndTimeifhourincolumnGissmaller
212/26/20035:00itisconsideredtobeininthefollowingday
312/26/20035:55
412/26/20036:506:0013:598
512/26/20037:4514:0021:596
612/26/20038:4022:006:002
712/26/20039:35
812/26/200310:30
912/26/200311:25
1012/26/200312:20
1112/26/200313:15
1212/26/200314:10
1312/26/200315:05
1412/26/200316:00
1512/26/200316:55
1612/26/200317:50
1712/26/200318:45
1812/26/200322:30
1912/27/20032:15
2012/27/20036:00
Sheet2


The formula in cell H4 is ...
Code:
=COUNTIF($E$2:$E$26,">="&INT($E2)+F4)-COUNTIF($E$2:$E$26,">="&INT($E2)+G4+(G4<F4))
and this is then copied over to cells H5 and H6.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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