+ Reply to Thread
Results 1 to 8 of 8

COUNTIFS function w/greater than or equal to, and less than or equal to time values

  1. #1
    Registered User
    Join Date
    03-27-2014
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    4

    COUNTIFS function w/greater than or equal to, and less than or equal to time values

    Hello,

    I am new to this forum and am just beginning to explore all the functions of Excel 2007 (so my terminology and understanding may not be up to par).

    I am currently creating a workbook that will pull data from patient sign in times to see how long their wait time was, to improve our offices efficiency.

    I want to count patients at different time intervals to see which step in our prep process takes the longest:
    0-3 minutes, 4-6 minutes, 7-9 minutes, and >10 minutes

    Example; The formula that I have in my cell is: =COUNTIFS(E2:E18,">=0:04",E2:E18,"<=0:06") which pulls 2 patients. However, when manually counting the data, the total amount of patients should be 3

    Is there another formula I should be using?

    I also tried: =COUNTIFS(C2:C18,">0:03",C2:C18,"<0:07") but that is counting the data for 3 minutes and 7 minutes, which I don't want.

    If you view the attachment: The data and formulas that I have in the total wait time section works perfectly with the same formulas described above.

    Very confused here,
    Thanks
    Attached Files Attached Files

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIFS function w/greater than or equal to, and less than or equal to time values

    Try
    =COUNTIFS(C2:C18,">=0:03",C2:C18,"<=0:07")

  3. #3
    Registered User
    Join Date
    03-27-2014
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: COUNTIFS function w/greater than or equal to, and less than or equal to time values

    It's pulling the 0:03 and 0:07 to the count (which is how it should be).

    I just want 4-6 minutes, which was what I was trying to get out of the first formula but it's not counting the 0:04's

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIFS function w/greater than or equal to, and less than or equal to time values

    OK, I think we have a floating point precision problem.
    Google it, it's a documented issue with how decimals are stored..

    Basically your result of 0:04 in C6 is not EXACTLY 4 minutes due to the precision issue.
    You can see this with
    =C6="0:04"+0
    That returns FALSE

    Need to round the results of the time subtraction.

    Try changing the formula in C2:C18 to
    =MROUND(B2-A2,"0:01"+0)
    This rounds the results to the nearest minute.

    Same for column F and H

  5. #5
    Registered User
    Join Date
    03-27-2014
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: COUNTIFS function w/greater than or equal to, and less than or equal to time values

    I'm still looking into what you call the floating point precision problem.

    I did put in the formula into C2:C18 and it is no longer giving me time values. 4 values read 0.01 and the rest are 0

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIFS function w/greater than or equal to, and less than or equal to time values

    Sorry, you have to format the cells as a Time ... h:mm


    It'll help if you include the word Excel in your google search.
    Look at this
    http://support.microsoft.com/kb/78113

  7. #7
    Registered User
    Join Date
    03-27-2014
    Location
    Detroit, MI
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: COUNTIFS function w/greater than or equal to, and less than or equal to time values

    I formatted the minute columns to time; h:mm and it seems to have worked!

    I was unaware of that issue, so thanks for that reference!

    Everything seems good =)

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: COUNTIFS function w/greater than or equal to, and less than or equal to time values

    Glad to help, thanks for the feedback.

+ 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. Conditional format time if less/equal to greater than a cell
    By lradney in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-27-2014, 04:05 PM
  2. Counting values in ColA is greater or equal to those in ColB
    By Hugh Evans in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 08-20-2012, 08:20 AM
  3. Counting values greater than or equal to those in another column
    By andyr85 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-26-2010, 04:15 PM
  4. Replies: 4
    Last Post: 04-24-2008, 10:08 AM
  5. Greater than or equal too IF function
    By Mavericks in forum Excel General
    Replies: 4
    Last Post: 01-06-2007, 02:15 PM

Tags for this Thread

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