+ Reply to Thread
Results 1 to 5 of 5

Using COUNTIFS does not return correct value when looking at Hours:Minutes:Seconds

  1. #1
    Registered User
    Join Date
    06-17-2013
    Location
    uk
    MS-Off Ver
    Excel 2010
    Posts
    4

    Using COUNTIFS does not return correct value when looking at Hours:Minutes:Seconds

    So, here is the issue.....

    I have a range of data that looks at the difference in time from one cycle to the next. This range can extend to 5000 cells. the format comes out as below

    00:00:40
    00:00:38
    00:00:39
    00:00:35
    00:00:46
    00:00:42
    etc.....

    What i need to calculate is the number of times an occurance falls into a certain time frame ( so how many occurances are between 00:00:40 and 00:00:45 for example)

    The formula i am using is below where the criteria changes depending on what range i am looking for.

    =COUNTIFS(E3:E4997,">=00:00:00",E3:E4997,"<=00:00:31")

    When i am calculating the lowest range (00:00:00 to 00:00:30) it does not calulate the correct amount and i have to change the <=00:00:30 to <=00:00:31 for it to be correct. Even then, the calulation may be out by a few.

    I have attached an example of the sheet and added some comments. Any help would be appriciated here as its doing my head in!!!!!
    Attached Files Attached Files

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Using COUNTIFS does not return correct value when looking at Hours:Minutes:Seconds

    You need to ommit second <= because then it will be used twice.

    In case exactly 00:00:31 both formulae will calculate it:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    You should use:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Same for all other formula.
    (Replace ; with ,)

  3. #3
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Using COUNTIFS does not return correct value when looking at Hours:Minutes:Seconds

    In cell F9 (and subsequent cells), modify your formula to avoid double counting.

    Original:
    Please Login or Register  to view this content.
    Suggested:
    Please Login or Register  to view this content.
    You've been double counting entries at 31 seconds.

    Cheers,
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  4. #4
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: Using COUNTIFS does not return correct value when looking at Hours:Minutes:Seconds

    Just to note: both (mine and ConneXionLost) approaches are OK.
    It's just important not to calculate same values twice.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Using COUNTIFS does not return correct value when looking at Hours:Minutes:Seconds

    Hi

    Either use Time decimal numbers in the COUNTIFS function or incorporate the TIME() function in the formula. e.g.

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. convert days hours minutes seconds to just minutes
    By hollylynn in forum Excel General
    Replies: 4
    Last Post: 08-28-2015, 08:53 AM
  2. Convert Days:Hours:Minutes:seconds to minutes.
    By Kevingardner1 in forum Excel General
    Replies: 4
    Last Post: 06-03-2014, 06:44 PM
  3. [SOLVED] Seconds to hours:minutes:seconds format
    By dalipsinghbisht in forum Excel General
    Replies: 1
    Last Post: 05-12-2013, 12:10 AM
  4. RE: Converting decimal minutes to hours, minutes and seconds
    By mills49 in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-14-2013, 09:14 AM
  5. convert from seconds to form hours: minutes: seconds?
    By nguyen_han in forum Excel General
    Replies: 2
    Last Post: 10-13-2011, 06:56 AM
  6. [SOLVED] Converting hours:minutes:seconds to just minutes
    By Dan Vagle in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-17-2006, 06:25 PM
  7. Help with Hours Minutes Seconds Please
    By Paul Black in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-14-2005, 04:06 PM
  8. [SOLVED] help with hours minutes and seconds
    By Rog in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-27-2005, 06:06 PM

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