# Formulae which can calculate the count between time range

1. ## Formulae which can calculate the count between time range

I have a list of data and is looking for formulaes.
I'm attaching an excel sheet along with this post. if someone can help.....

I'm trying to count the data between a range of time.  Register To Reply

2. It is not clear what you mean by counting entries between every half hour. Does that mean you would only count the first 12 entries? Please elaborate.  Register To Reply

3. Try =SUMPRODUCT(--(A2:A796>TIME(0,0,0)),--(A2:A796<=TIME(1,0,0))). The error was coming from using A1 in the second range; sumproduct ranges have to be the same size. Also, when using text around numbers, you have to add 0 or multiply or divide by 1 to make it become a number again. It is easier to just use the time formula. As you had it though, this also works: =SUMPRODUCT(--(A2:A796>"00:00"+0),--(A2:A796<="01:00"+0)).
Edit: Sorry didn't read the workbook clearly enough. Your formula has hour-long buckets, but that can be updated to half hour in either version. To get the average, you could use ``Please Login or Register  to view this content.``  Register To Reply

4. The OP used the "double unary" to convert the text times to numeric times... so the only error was that A1 in the 2nd condition needs to be changed to A2 to match the sizes.  Register To Reply

5. When I remove +0, it gives me 0 for an answer. Correct answer is 25.  Register To Reply

6. All I did was open the OP's file and changed the A1 to A2 in the 2nd array condition. I got a result of 25  Register To Reply

7. I used what I had without +0 and got that result. Strangely, the +0 was all I added to make it work (aside from changing A1 to A2). It didn't give me 25 until after I added +0. Oh well, not worth debating about at this point anyway.  Register To Reply