+ Reply to Thread
Results 1 to 6 of 6

[SOLVED] Equations using time

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    [SOLVED] Equations using time

    I have a problem where i have some set times. These times are described in local hours. i need to find the GMT equivalent, and the EST equivalent.

    When i do a simple =F2+C2 it works and gives me the correct value.

    1) When i subtract more then there is value, it ends up with "#######" ex. =H2-C2
    2) I need the 24 hour clock to work, where it uses 24:00 as 12PM instead of 00:00 ex. =i3-E3
    3) i will also need to take the GMT time and subtract 5 hours for EST. Apparently subtracting a # from time does not work. Most likely because its a difference in formatting, so i temporarily used a column with the time value i wanted to subtract.

    Are any of these possible?

    I have attached a sample Sheet so that you can see what i am working with, hope it helps.
    Attached Files Attached Files
    Last edited by JukeBoxHero; 08-22-2012 at 03:16 PM.

  2. #2
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Equations using time

    edited:-

    Ignore what I asked, that was me being a bit dense, I realised after you want time, not time difference.

    In H3 =D3+1-$C3

    Fill right, then down.
    Last edited by jason.b75; 08-22-2012 at 12:54 PM.

  3. #3
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Equations using time

    That worked. Thank you very much. If you don't mind me asking, what is the logic behind that?

    Any ideas on how to fix the #2 or #3?

  4. #4
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Equations using time

    Subtracting from time works, as long as the difference is greater or equal to 0.

    Try something like =MOD(A1-B1, 1)
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Equations using time

    The logic is to add a day to the time you're subtracting from in order to make that time greater than 24 hours, the value you subtract is time only so will always be less, eliminating the negative results that cause the ###### error.

    To get the format you want in #2 takes a little more creative thinking.

    In H3 =MOD(D3+1-$C3-"00:00:01",1)+"00:00:01"

    Custom format [h]:mm

    For question #3,

    In L3 =MOD(H3+1-"04:59:59",1)+"00:00:01"

    Custom format [h]:mm

  6. #6
    Registered User
    Join Date
    06-07-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2010
    Posts
    18

    Re: Equations using time

    Thank you Very much for your help. i definitely appreciate your help. this will make my life a lot easier today.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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