+ Reply to Thread
Results 1 to 8 of 8

Difference between Time formula

  1. #1
    Registered User
    Join Date
    08-30-2016
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    35

    Difference between Time formula

    Hey guys, i've got a pivot table which spits out the following.

    So eg Cell B1 will equal 15/11/2016 6:50:28AM and cell C1 will equal 15/11/2016 3:28:12PM. I need a formula i can use or use in a calculated field to get the difference between the 2 cells in hours. So eg 8 hours 38 min or whatever it is.

    I tried B1 - C1 which came up with 0.35 which i can't get to equate to a time period.


    Cheers

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Difference between Time formula

    0.35 is representing roughly a third of a day, that is, roughly 8 hours. Format as hh:mm:ss.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    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,933

    Re: Difference between Time formula

    What you need to understand about dates and times in excel is...

    a date is just a number representing the number of days passed since 1/1/900...and then formatted in a way that we recognize as a date. So, for instance, today (Wed Feb 2017) is actually 42781

    Time is actually a decimal part of 1 (day), so 06:00 AM is 0.25, 12 noon is 0.5 and 18:00 (or 6 PM) is 0.75
    sounds like your answer is correct, as Trevor suggested, just format it as needed
    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

  4. #4
    Registered User
    Join Date
    08-30-2016
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    35

    Re: Difference between Time formula

    Next question is how do i do that in a calculated field. B1 is Min of Time and B2 is Max of time. I tried putting into the formula bar in the calculated field ='Min of Time'-'Max of Time' but it came up with an error.

  5. #5
    Registered User
    Join Date
    08-30-2016
    Location
    Sydney
    MS-Off Ver
    2010
    Posts
    35

    Re: Difference between Time formula

    Bump would be really appreciated

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Difference between Time formula

    Nothing to work with. Post a sample workbook.

  7. #7
    Registered User
    Join Date
    11-05-2014
    Location
    Muscat
    MS-Off Ver
    2010
    Posts
    7

    Re: Difference between Time formula

    If your formula C1-B1 gives you 0.35, then right click on this cell (0.35) and select "Format Cells". Then select custom and type in either hh:mm:ss (as suggested above) or [h]:mm to allow for amounts over 24 hours.

  8. #8
    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,933

    Re: Difference between Time formula

    If you want to subtract the min time from the max time in a range, maybe something like...
    =max(A1:A10)-min(A1:A10)

+ 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. [SOLVED] Need Formula to for time difference with 0d 00h 00m formats
    By switzd0d in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-13-2015, 02:45 AM
  2. Averaging Time after using formula to determine time difference
    By Yfandeslady in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-26-2014, 03:22 PM
  3. [SOLVED] time difference formula - need fix
    By Lukael in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-21-2014, 12:58 AM
  4. [SOLVED] Formula for time difference
    By MyOnion in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-19-2013, 03:13 AM
  5. Time difference formula help
    By gcwozniak in forum Excel General
    Replies: 2
    Last Post: 05-24-2011, 10:08 PM
  6. [SOLVED] Need formula to calculate time difference
    By markndawoods in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 07-13-2006, 11:25 AM
  7. Time Difference Formula
    By MEL79 in forum Excel General
    Replies: 2
    Last Post: 03-11-2005, 05:57 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