Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default counting cells within certain time frames - 24 hour clock

I am looking to count the number of cells that meet criteria in a 24 hour
clock format.

The cell range is C2:C1395.
If a time falls between 00:00:00 and 00:59:59, I want to count it. This
would continue for the remaining 23 hours

I was able to get this to work at one point using COUNTIF, but now it is not
functioning and an error keeps appearing. Also, would it make a difference in
the formula if I was using Excel 03 versus 07?

Thanks for any help.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default counting cells within certain time frames - 24 hour clock

Times are stored by Excel as fractions of a 24-hour day, so 1 hour is
actually 1/24, 2 hours is 2/24 etc.

If you put 1 to 24 in (for example) E2:E25, then you can start with
this in F2:

=COUNTIF(C$2:C$1395,"<"&E2/24) - COUNTIF(C$2:C$1395,"<"&E1/24)

assuming E1 is blank. Then just copy this down to F25, where the
numbers in column E represent the hours that you are counting up to
(excluding them).

Hope this helps.

Pete

On May 5, 4:55*pm, lummox wrote:
I am looking to count the number of cells that meet criteria in a 24 hour
clock format.

The cell range is C2:C1395.
If a time falls between 00:00:00 and 00:59:59, I want to count it. This
would continue for the remaining 23 hours

I was able to get this to work at one point using COUNTIF, but now it is not
functioning and an error keeps appearing. Also, would it make a difference in
the formula if I was using Excel 03 versus 07?

Thanks for any help.


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default counting cells within certain time frames - 24 hour clock

Try these. Assuming no empty cells.

12:00:00 AM to 12:59:59 AM

=SUMPRODUCT(--(HOUR(A1:A10)=0),--(HOUR(A1:A10)<1))

1:00:00 AM to 1:59:59 AM

=SUMPRODUCT(--(HOUR(A1:A10)=1),--(HOUR(A1:A10)<2))

Follow that pattern until you get to

23:00:00 to 23:59:59

=SUMPRODUCT(--(HOUR(A1:A10)=23),--(A1:A10<1))

--
Biff
Microsoft Excel MVP


"lummox" wrote in message
...
I am looking to count the number of cells that meet criteria in a 24 hour
clock format.

The cell range is C2:C1395.
If a time falls between 00:00:00 and 00:59:59, I want to count it. This
would continue for the remaining 23 hours

I was able to get this to work at one point using COUNTIF, but now it is
not
functioning and an error keeps appearing. Also, would it make a difference
in
the formula if I was using Excel 03 versus 07?

Thanks for any help.



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default counting cells within certain time frames - 24 hour clock

No luck on either of the suggestions. Any other options?


"T. Valko" wrote:

Try these. Assuming no empty cells.

12:00:00 AM to 12:59:59 AM

=SUMPRODUCT(--(HOUR(A1:A10)=0),--(HOUR(A1:A10)<1))

1:00:00 AM to 1:59:59 AM

=SUMPRODUCT(--(HOUR(A1:A10)=1),--(HOUR(A1:A10)<2))

Follow that pattern until you get to

23:00:00 to 23:59:59

=SUMPRODUCT(--(HOUR(A1:A10)=23),--(A1:A10<1))

--
Biff
Microsoft Excel MVP


"lummox" wrote in message
...
I am looking to count the number of cells that meet criteria in a 24 hour
clock format.

The cell range is C2:C1395.
If a time falls between 00:00:00 and 00:59:59, I want to count it. This
would continue for the remaining 23 hours

I was able to get this to work at one point using COUNTIF, but now it is
not
functioning and an error keeps appearing. Also, would it make a difference
in
the formula if I was using Excel 03 versus 07?

Thanks for any help.




  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default counting cells within certain time frames - 24 hour clock

Are you sure your times are true Excel times? Do the entries also contain
dates, like this 1/1/2009 22:15:00 ? In Excel, time is really a number, the
fractional part of a day (which has a value of 1), formatted to look like a
time entry. 12:00 PM is half a day so half of 1 is 0.5. The true value of
12:00 PM is 0.5.

You can test to see if the entries are true time values by using one of
these formulas:

=COUNT(A1)
=ISNUMBER(A1)

If the entry in A1 is a true Excel time value COUNT will return 1 and
ISNUMBER will return TRUE.

--
Biff
Microsoft Excel MVP


"lummox" wrote in message
...
No luck on either of the suggestions. Any other options?


"T. Valko" wrote:

Try these. Assuming no empty cells.

12:00:00 AM to 12:59:59 AM

=SUMPRODUCT(--(HOUR(A1:A10)=0),--(HOUR(A1:A10)<1))

1:00:00 AM to 1:59:59 AM

=SUMPRODUCT(--(HOUR(A1:A10)=1),--(HOUR(A1:A10)<2))

Follow that pattern until you get to

23:00:00 to 23:59:59

=SUMPRODUCT(--(HOUR(A1:A10)=23),--(A1:A10<1))

--
Biff
Microsoft Excel MVP


"lummox" wrote in message
...
I am looking to count the number of cells that meet criteria in a 24
hour
clock format.

The cell range is C2:C1395.
If a time falls between 00:00:00 and 00:59:59, I want to count it. This
would continue for the remaining 23 hours

I was able to get this to work at one point using COUNTIF, but now it
is
not
functioning and an error keeps appearing. Also, would it make a
difference
in
the formula if I was using Excel 03 versus 07?

Thanks for any help.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I subtract time where hh:mm:ss:ff (frames = 30 frames/sec) KJ7 Excel Discussion (Misc queries) 14 December 3rd 16 10:03 AM
24 hour clock formula for elapsed time between 1215 and 1630 Tader Excel Worksheet Functions 1 April 6th 09 05:23 PM
Counting time-frames Ken G. Excel Discussion (Misc queries) 2 August 12th 08 01:11 PM
time diffrence with 24 hour clock Rich Mcc Excel Worksheet Functions 3 October 25th 06 03:39 PM
Counting the number of cells within a certain hour. Joker Excel Discussion (Misc queries) 10 February 18th 06 03:04 PM


All times are GMT +1. The time now is 02:12 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"