+ Reply to Thread
Results 1 to 7 of 7

Formulae which can calculate the count between time range

  1. #1
    Registered User
    Join Date
    11-28-2008
    Location
    India
    Posts
    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.
    Attached Files Attached Files

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    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.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    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.
    Last edited by darkyam; 11-28-2008 at 05:06 PM. Reason: To improve answer.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    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.

  5. #5
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    When I remove +0, it gives me 0 for an answer. Correct answer is 25.

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    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

  7. #7
    Forum Expert darkyam's Avatar
    Join Date
    03-05-2008
    Location
    Houston, TX
    MS-Off Ver
    2013
    Posts
    2,191
    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.
    Last edited by darkyam; 11-28-2008 at 05:34 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1