+ Reply to Thread
Results 1 to 5 of 5

Formula not returning correct result. Formatting error or formula error?

  1. #1
    Registered User
    Join Date
    12-05-2013
    Location
    Nashville
    MS-Off Ver
    Excel 2010
    Posts
    32

    Formula not returning correct result. Formatting error or formula error?

    Good morning,

    I am using the below formula to determine a score based on a range of results. The Source cell is currently formatted as [h]:mm:ss. In the example, Cell H33 has 0:11:49 and Cell H34 (results) has a score of 5 which isn't inline with the formula.

    How can I get the below formula to recognize the data in cell H33 and return the correct result?

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


    Thanks

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Formula not returning correct result. Formatting error or formula error?

    A result of 5 looks perfectly in line with the logic of the formula. Can you explain why it is not?

    My guess is it is related to not understanding how Excel stores dates/times (review this: http://www.cpearson.com/Excel/datetime.htm ). If H33 contains 0:11:49 (my interpretation is 11 minutes 49 seconds), this is stored in Excel as the number 0.00821, which is much less than 449.9, so Excel returns 5. A cell value of 450 would correspond to about 10800 hours, so I would not expect a result other than 5 until your input cell is greater than 10800 hours.

    I am not sure how to read your formula, so I cannot recommend a specific solution. I would make two recommendations. 1) Study how Excel stores date/time values so you know exactly what values to put into your comparison formula. 2) Unrequested, but I would probably make this a lookup table lookup function -- especially if the number of conditions can become larger or the cutoff points may change. In my opinion, a lookup table/lookup function approach will be more flexible -- if flexibility is needed.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  3. #3
    Registered User
    Join Date
    12-05-2013
    Location
    Nashville
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Formula not returning correct result. Formatting error or formula error?

    Basically what I am calculating is end of year performance results for a call center. This is an average handle time metric and the ranges are in seconds. a 5 rating would be 449.9 seconds or below. A 4 rating is 450 - 509.9 seconds. A 3 rating is 510 - 569.9 seconds, A 2 rating is 570 - 630 seconds and a 1 rating is 630 seconds and above.

    The result for the agent is 709 seconds which I attempted to convert to minutes and seconds. At 709 seconds the rating should be a 1.

    5 rating = 449.9 and under
    4 rating = 450 – 509.9 sec’s
    3 rating = 510 - 569.9 sec’s
    2 rating = 570 – 630 sec’s
    1 rating = > 630 sec’s

    Your idea of using a lookup table may be the best solution and I haven't thought of that. (New to excel formulas)

  4. #4
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,829

    Re: Formula not returning correct result. Formatting error or formula error?

    As explained in the link, Excels stores time values as fractions of a day, So 450 seconds is (450/3600/24) 0.0052083333 of a day. Setting this up as a lookup table:
    Please Login or Register  to view this content.
    Then, using the "approximate match" option =VLOOKUP(H33,$B$2:$C$6,3,TRUE). Remember that the time time value in the lookup function must be a time serial number (number format should not matter) as long as the time value is an actual time value (assuming times between 0 and 1000 seconds are typical, the actual values in the lookup should be between 0 and 0.0116).

    If you decide to stick with the IF() function, you just need to convert your decimal seconds values into a time serial number using any of the suggested functions in column B above. =IF(...(IF(H33<T I M E (0,0,450),5,IF(...)) [spaces added because the site's firewall doesn't like me today]

  5. #5
    Registered User
    Join Date
    12-05-2013
    Location
    Nashville
    MS-Off Ver
    Excel 2010
    Posts
    32

    Re: Formula not returning correct result. Formatting error or formula error?

    Thank you for the response. This is much more advanced than I currently understand but I will review the link you sent and increase my knowledge in this area.

+ 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. Formula not returning correct result using MODE() function
    By jackmcguigan1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2016, 01:15 PM
  2. Formula not returning correct result
    By Patcheen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-20-2016, 07:05 PM
  3. >= formula not returning correct result when it is =
    By SMITH.CRYSTAL in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-15-2016, 12:50 PM
  4. Replies: 2
    Last Post: 02-26-2012, 09:45 AM
  5. Conditional formula with summation not returning correct result
    By Fattyfatfat Kid in forum Excel General
    Replies: 4
    Last Post: 10-03-2011, 02:03 AM
  6. [SOLVED] IF formula with correct formatting in result
    By tmp4 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2006, 12:15 AM
  7. Replies: 4
    Last Post: 03-24-2006, 07:20 AM

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