+ Reply to Thread
Results 1 to 9 of 9

Time Values Difference

  1. #1
    Registered User
    Join Date
    12-03-2013
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Time Values Difference

    I'm trying to find the difference two cells within a row to another row.

    I'm using time values i.e 17:07 and 14:53 and in the third cell I'd like to get a result that shows me a plus/minus of the differences.

    I know by looking what math to apply to that particular cell. Is there a way to do a formula to get the results no matter if they are plus or minus. without having to change the formula back and for on if i know it'll be increasing or decreasing?

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Time Values Difference

    Hi and welcome to the forum

    would something like this work for you?

    A1=17:00
    A2=15:00
    A3=IF(A2>A1,A1-A2,A1-A2).....=2:00
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Time Values Difference

    Eventually try File - Options - Advanced - Under " when calculating for this workbook" check " Use 1904 date system"

  4. #4
    Registered User
    Join Date
    12-03-2013
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Time Values Difference

    This works perfect untill I get to a time that increases then it will not calculate it, this is the same thing I ran into earlier

  5. #5
    Registered User
    Join Date
    12-03-2013
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Time Values Difference

    Actually if I take the formula that FDibbins gave me and pair it with what Pepe gave me, it works perfect!

    Thanks so much!

  6. #6
    Registered User
    Join Date
    12-03-2013
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Time Values Difference

    What if the times were in seconds? It does not seem to carry over if I apply the formula to seconds

  7. #7
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Time Values Difference

    A1=17:00
    A2=15:00
    A3=IF(A2>A1,A1-A2,A1-A2).....=2:00

    That should work with second or no second, it is a simple math calc. Time is just a decimal of 1 (day), 6:00 am = 0.25, 12 midday = 0.5 etc, so all seconds do is add to the decimals

  8. #8
    Registered User
    Join Date
    12-03-2013
    Location
    Knoxville, TN
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Time Values Difference

    I'm not sure what I'm doing wrong, it's only certian cells that it's giving me "#VALUE!"

    i.e 1:49 and :26


    nevermind, I found the issues. Needed to add a zero i.e 0:26


    thanks again! you rock

  9. #9
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Time Values Difference

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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. difference in milliseconds between time values
    By aocana in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 10-11-2013, 05:23 AM
  2. difference in milliseconds between time values
    By bigbillis in forum Excel General
    Replies: 3
    Last Post: 12-30-2010, 01:34 PM
  3. error calculating negativ difference time values
    By Xavier in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-26-2006, 07:00 PM
  4. [SOLVED] Calculating Absolute Difference Between Two Time Values
    By markxus in forum Tips and Tutorials
    Replies: 3
    Last Post: 08-10-2005, 01:43 AM
  5. Replies: 1
    Last Post: 03-25-2005, 01:06 PM

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