Are the "times" actual EXCEL TIME or a string?
 
If it's ACTUAL Excel time, then the values are actually numbers.
That is, the fractional part of a day.
 
6:00am is .25
6:00pm is .75
 
So, to determine how many values are between 7:00am and 7:59am,
you're actually wanting to count the number of values >= 7:00am
and subtract the number >= 8:00am.
 
Let's say your time values are in column "A".
In column  C (row 1-24) I put the times:
 
12:00:00 AM
1:00:00 AM
2:00:00 AM
etc.
Then, in cell D1, I put:
=COUNTIF(A:A,">=" &C1)-COUNTIF(A:A,">=" &C1+1/24)

and copied it down.

My sample data had 1000 values.
The sum of the counts equalled 1000!!!

Now, if you time values have DAY and time, then you have to get a bit trickier.

Because today, at 2:58pm, the value is:
41515.6236111111

But yesterday at 2:58 pm, the value is:
41514.6236111111

So, if you're using the countif of only the "time" portion, then
the number count will not be what you expect.

Good luck.

Paul
-----------------------------------------
“Do all the good you can,
By all the means you can,
In all the ways you can,
In all the places you can,
At all the times you can,
To all the people you can,
As long as ever you can.” - John Wesley
-----------------------------------------


>________________________________
>From: Diannaha Thompson <littlesqueak2...@gmail.com>
>To: excel-macros@googlegroups.com 
>Sent: Thursday, August 29, 2013 2:15 PM
>Subject: $$Excel-Macros$$ Counting the number of times in a range
>
>
>
>Ok so I have this list of times 7am, 8am, 7:30, 9, 9:20am and etc. for 
>example. I need to count how many times occur in a range. So 7:00-7:59 occurs 
>twice 8am-8:59 occurs once. I have tried a count if function but it didin't 
>work. I must be entering something wrong.-- 
>Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
>=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
>https://www.facebook.com/discussexcel
> 
>FORUM RULES
> 
>1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
>Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
>quick attention or may not be answered.
>2) Don't post a question in the thread of another member.
>3) Don't post questions regarding breaking or bypassing any security measure.
>4) Acknowledge the responses you receive, good or bad.
>5) Jobs posting is not allowed.
>6) Sharing copyrighted material and their links is not allowed.
> 
>NOTE : Don't ever post confidential data in a workbook. Forum owners and 
>members are not responsible for any loss.
>--- 
>You received this message because you are subscribed to the Google Groups "MS 
>EXCEL AND VBA MACROS" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to excel-macros+unsubscr...@googlegroups.com.
>To post to this group, send email to excel-macros@googlegroups.com.
>Visit this group at http://groups.google.com/group/excel-macros.
>For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
Are you =EXP(E:RT) or =NOT(EXP(E:RT)) in Excel? And do you wanna be? It’s 
=TIME(2,DO:IT,N:OW) ! Join official Facebook page of this forum @ 
https://www.facebook.com/discussexcel

FORUM RULES

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.
2) Don't post a question in the thread of another member.
3) Don't post questions regarding breaking or bypassing any security measure.
4) Acknowledge the responses you receive, good or bad.
5) Jobs posting is not allowed.
6) Sharing copyrighted material and their links is not allowed.

NOTE  : Don't ever post confidential data in a workbook. Forum owners and 
members are not responsible for any loss.
--- 
You received this message because you are subscribed to the Google Groups "MS 
EXCEL AND VBA MACROS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to excel-macros+unsubscr...@googlegroups.com.
To post to this group, send email to excel-macros@googlegroups.com.
Visit this group at http://groups.google.com/group/excel-macros.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to