+ Reply to Thread
Results 1 to 11 of 11

countif between a date/time range

  1. #1
    Forum Contributor
    Join Date
    01-17-2008
    Posts
    156

    countif between a date/time range

    hi,

    how can i use countif or sumproduct or sumif ..etc to calculate how many occurrence in a specify date and time .

    Pls see example.
    Attached Files Attached Files
    Last edited by okl; 09-24-2009 at 03:35 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: countif between a date/time range

    Are you looking to return the results as per your sample - ie a 1 in the appropriate column on each row ? Or are you looking to do a cumulative count in one cell for each time frame ?

  3. #3
    Forum Contributor
    Join Date
    01-17-2008
    Posts
    156

    Re: countif between a date/time range

    Hi Donkey,

    Cumulative count in one cell for each time frame..

    Thanks

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: countif between a date/time range

    Given your bands aren't even (03:00 -> 15:00, 15:01 -> 03:00, 03:01 -> 15:00 etc...) a common formula is obviously little convoluted so keeping things simple(ish):

    If we assume

    Please Login or Register  to view this content.
    then

    Please Login or Register  to view this content.
    then

    Please Login or Register  to view this content.
    First of course you must ensure the values in B are date time values... when I opened your file they were numbers stored as text rather than being true numbers, to convert run Text to Columns on Column B (click Finish).

  5. #5
    Forum Contributor
    Join Date
    01-17-2008
    Posts
    156

    Re: countif between a date/time range

    Hi Donkey,

    How about just a 1 in each column/row, as per my sample.
    Seem easier..

    Thanks

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: countif between a date/time range

    It's not really any easier - you still need to coerce values in B to be numeric and specify start / end times for each column to ascertain band
    (and I would not to say the prior approach is overly complex)

  7. #7
    Forum Contributor
    Join Date
    01-17-2008
    Posts
    156

    Re: countif between a date/time range

    Thanks got it work!
    Attached Files Attached Files

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: countif between a date/time range

    OK that's good but I don't understand the need for the formulae in row 3 onwards.

  9. #9
    Forum Contributor
    Join Date
    01-17-2008
    Posts
    156

    Re: countif between a date/time range

    Yes, just need to apply the formula in row 2, row 3 onwards are unnecessary ..

  10. #10
    Forum Contributor
    Join Date
    01-17-2008
    Posts
    156

    Re: countif between a date/time range

    Hi,

    If i add in a new column Quality, how can i count no of items occurred in that date/time range.

    Pls see sample.
    Attached Files Attached Files

  11. #11
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: countif between a date/time range

    Change the COUNTIFs to SUMIFs, eg:

    D4: =SUMIF($B:$B,">="&D$2,$C:$C)-SUMIF($B:$B,">="&E$2,$C:$C)

+ 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