+ Reply to Thread
Results 1 to 6 of 6

How to calculate difference in time?

  1. #1
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    Question How to calculate difference in time?

    Hi,

    Is it possible to calculate the difference in time as example below?

    A1 = 4/12/2010 4:11:00 PM
    A2 = 5/12/2010 4:15:00 PM
    A3 = A2- A1 = 24 hrs 4 mins.

    Regards,
    Lewis

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to calculate difference in time?

    The way you did it is fine. Just format the result as [h]:mm
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: How to calculate difference in time?

    Custom Format the cell as
    [hh] "hrs "mm" min"
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  4. #4
    Forum Contributor
    Join Date
    02-11-2009
    Location
    Montclair, NJ
    MS-Off Ver
    Excel 365
    Posts
    236

    Re: How to calculate difference in time?

    This looks good

    A1 = 4/12/2010 4:11:00 PM
    A2 = 5/12/2010 4:15:00 PM

    Now, in Cell A3, either:

    Option 1: Type in: A3 = A2- A1
    then format the cell to "h:mm"

    Option 2: In A3, type in: =TEXT(A2-A1,"h:mm")

  5. #5
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: How to calculate difference in time?

    Option 2: In A3, type in: =TEXT(A2-A1,"h:mm")
    Why would you want a formula that returns a text result for a numeric value?

  6. #6
    Forum Contributor
    Join Date
    07-29-2005
    Location
    Singapore
    MS-Off Ver
    2007
    Posts
    253

    Question Re: How to calculate difference in time?

    Quote Originally Posted by shg View Post
    The way you did it is fine. Just format the result as [h]:mm
    Hi, thanks. I got it. :-)

+ 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