+ Reply to Thread
Results 1 to 4 of 4

Subtracting Date and Time

  1. #1
    Registered User
    Join Date
    08-11-2009
    Location
    Virginia Beach, va
    MS-Off Ver
    Excel 2007
    Posts
    2

    Subtracting Date and Time

    I need to subtract a cell containing a date and time from another cell containing a date and time. For instance, in cell A1, I have 08/100/2009 12:00 and in A2, I have 08/12/2009 09:00. In A3, I would like it to output 1 day and 21 hours.

    Is this possible?

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Subtracting Date and Time

    It depends in part on how big the variances are likely to get between start & end... if less than say 31 days then you could use:

    A3: =A2-A1
    Custom Format of: d "Day(s) and "h "Hour(s)"

    If the variance goes beyond say 31 days then a revised approach is generally required.

  3. #3
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Subtracting Date and Time

    Enter formula in A3
    =A2-A1

    Custom Format A3
    "Day" h "hours"
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  4. #4
    Registered User
    Join Date
    08-11-2009
    Location
    Virginia Beach, va
    MS-Off Ver
    Excel 2007
    Posts
    2

    Talking Re: Subtracting Date and Time

    It worked. Thanks a bunch!

+ 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