+ Reply to Thread
Results 1 to 8 of 8

Getting a formula to Evaluate Time Properly

  1. #1
    Registered User
    Join Date
    07-16-2008
    Location
    africa
    Posts
    5

    Getting a formula to Evaluate Time Properly

    Good morning everyone,

    i ran into a bottle of confusion this morning - hope some one can help -

    this is my formula -

    =INT(Q27/7*24)&" days, "&TEXT(MOD(Q27,7/24),"h"" hrs ""m"" mins""")

    Q27 = 14:00

    Format: [hh]:mm

    evaluates: #VALUE!

    i tried changing the formats, entries.....

    If Q27 = 14:04

    evaluates: 2 days, 0 hrs 1 mins
    ----------------------------------------------

    can someone please help, i'm pulling my hair out....thank you ssssoo much in advance...
    Last edited by tehmole; 08-22-2008 at 11:14 AM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Hi,

    Please read our forum rules and post a title that is more descriptive of your question.
    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 NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    With that formula, you have to enter 14:00 literally that way..not just 14... Then you will get a result.

  4. #4
    Registered User
    Join Date
    07-16-2008
    Location
    africa
    Posts
    5
    i do enter 14:00 -

    if you plot in 21:00 it'll display #VALUE!


    but then if you plot 20:35 it will display 2 days, 6hrs 35 mins

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Your Mod() function is returning a negative...and you can't have negative time.

    Try inserting the ABS() function:

    =INT(Q27/7*24)&" days, "&TEXT(ABS(MOD(Q27,7/24)),"h"" hrs ""m"" mins""")

  6. #6
    Registered User
    Join Date
    07-16-2008
    Location
    africa
    Posts
    5
    thank you so much NBVC

    worked like a charm..........ty ty ty

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675
    Quote Originally Posted by NBVC View Post
    Your Mod() function is returning a negative
    Interesting. Because 7/24 is positive the result of MOD(x,7/24) can't ever be negative.......in theory

  8. #8
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    I noticed that too...

    It seems when the result of the Mod(Q27,7/24) should be 0, it gives the negative result....

    maybe it has to do with the precision of 7/24?

+ 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. Protected Formulas
    By georgeeasten in forum Excel General
    Replies: 13
    Last Post: 12-10-2018, 12:47 AM
  2. Formula for Time Taken Per Kilometer
    By Justinmih in forum Excel General
    Replies: 13
    Last Post: 07-05-2008, 11:18 AM
  3. Replies: 3
    Last Post: 09-29-2007, 04:58 PM
  4. need help with formula for time
    By Leelaakk in forum Excel General
    Replies: 3
    Last Post: 11-17-2006, 07:49 PM
  5. Time Formula?
    By Praefect in forum Excel General
    Replies: 2
    Last Post: 09-12-2006, 02:35 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