+ Reply to Thread
Results 1 to 4 of 4

Adding / Subtracting TIME VAULES / UNITS (Not time of Day) - I'm lost ... [RESOLVED]

  1. #1
    Registered User
    Join Date
    02-08-2004
    Posts
    58

    Adding / Subtracting TIME VAULES / UNITS (Not time of Day) - I'm lost ... [RESOLVED]

    .
    [RESOLVED]
    (Thanks to JBeauacire)




    Hey all ! I have been away for a long, long time.

    I have a little simple sheet that is kicking my @$$ ! I cannot figure out hour to get this ONE value of time ...

    --------------------------

    I want to take my total time (already calculated), and subtract 12 hours.

    If the total value is zero or less, then nevermind. BUT if it is greater than zero, then display the difference....

    ( Example: 12:30, minus 12:00, = :30 )

    --------------------------




    Problem is, I discovered, is Excel time doesn't just work like that. It keeps thinking I want to subtract times of the day, giving me another time of the day...

    After long searching I converted the sheet to 1904 time and still no luck. (In order to try different formulas and try negatives)...

    I have tried changing the formula 102'ish different ways to achieve the same thing, but all the same wrong'ish results.




    I have attached a sample sheet for viewing. (I am trying to change the CONTINUOUS TIME cell (A5) , which works correctly SOMETIMES depending on what start/stop times are entered)

    ***As Example, the sheet shows a clock out time of 12:05. And correctly displays the overage as :35 minutes. BUT, just try and change the clock out (tie up) time to, say, 11:00 , and everything goes wrong.




    I KNOW it has to be possible, I just cant figure it out !


    Thanks everyone !
    Attached Files Attached Files
    Last edited by BaLLZaCH; 03-21-2015 at 10:00 PM. Reason: [RESOLVED] Thanks to JBeauacire
    Sig ? How can I sign the computer screen ?

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Adding / Subtracting TIME VAULES / UNITS (Not time of Day) - I'm lost ... Please help.

    The formulas I recommend are:

    A4: =(A2-A1)+(A1>A2)
    A5: =MAX(0, H4-TIMEVALUE("12:00 PM"))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-08-2004
    Posts
    58

    Re: Adding / Subtracting TIME VAULES / UNITS (Not time of Day) - I'm lost ... Please help.

    Wow ..... OK ,,,

    So I know you meant "A4" not "H4", and... It worked perfect....


    I have never used the "MAX" option ,,,, didn't know it existed, I don't even know what to say but thank you!

    So, This is resolved.... !!! You nailed it with the TIMEVALUE, and thanks for the lesson on MAX!!!

    Thank you so much JB !!!
    +1 on Rep !

    [RESOLVED]

    -------------------------------------------------------------


    EDIT:
    EXTRA NOTES :

    ***NOTES: To anyone who found this page searching for a similar issue, as JB pointed out, you can use the - (or + or whatever) TIMEVALUE(xx:xx) and you don't specifically have to have the AM or PM afterwards, it just so happens works in this case but you can leave off the AM/PM if needed.

    IF you needed to change the sheet to 1904 filesystem (I found during searching that PCs use 1900 and MACs use 1904 as default.... for compatibility reasons, or, the reason I found it was for NEGEATIVE values (because otherwise you get errors with 1900 and neg.), so if you change to 1904 you CAN get negatives (Do your own research).... I don't need negs. anymore, just interesting info... - But to change it, go to TOP LEFT OF EXCEL, click the |-> "DOWN ARROW", click MORE COMMANDS. Click ADVACNED, scroll down to "When Calculating This Workbook" , click the "1904" checkbox, and save.

    And as a side note, I never used MAX formula. Thank you JB for pointing that out. It basically prevents an extra line of code that says "if less than xxx then xxx or xxx" ... so in his example, if a-b=less than zero, nothing .... But if more than zero, then display result. Thanks again.

    I just wanted to add side-notes in case somebody ran across this searching, and I hope it may help.

    Thank you to EXCELFORUM members !!!


    Again, [RESOLVED], and thank you.
    Last edited by BaLLZaCH; 03-22-2015 at 02:56 PM.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Adding / Subtracting TIME VAULES / UNITS (Not time of Day) - I'm lost ... [RESOLVED]

    Glad to help. For your convenience you can select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. adding and subtracting date and time
    By greenmal in forum Excel General
    Replies: 3
    Last Post: 09-22-2014, 06:59 PM
  2. Adding units of time in 2007
    By jimcpenrodjr in forum Excel General
    Replies: 1
    Last Post: 06-04-2010, 02:35 AM
  3. Adding/Subtracting Time Help...
    By killertofu in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-15-2006, 04:49 PM
  4. [SOLVED] adding/subtracting time
    By griffee@email.com in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-11-2006, 10:50 AM
  5. Adding small units of time and entering them quickly
    By ckdkvk in forum Excel General
    Replies: 1
    Last Post: 01-04-2006, 04: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