+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    03-03-2010
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    1

    Excel Formula trying to calculate difference between two dates

    Hi there, I'm new here and I'm hoping someone can help. I'm creating a spreadsheet to record survey data in. It's airline stuff and I'm trying to be smart and calculate the difference between two times so I can say whether the flight took off early, was on time or was late. I've simply subtracted one cell from the other which, where the flight was on time is fine the formula chucks back 00:00 or where the flight was late it shows 00:42 but where it was early i've got loads of ######### because it won't show time as being a negative I think.

    Anyone know how i can show it? I would then like to put a conditional colour format on showing early as green, on time as green and red as late.

    Any help would be gratefully received. Thank you

  2. #2
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Excel Formula trying to calculate difference between two dates

    Using the 1900 Date System it is not possible (as you can see) to show negative time value in a Time format. If you format the cell to General you will see the underlying value.

    There are fixes ranging from

    a) switching date system (ill advised IMO)

    to

    b) storing the time values as Decimal, ie * result by 24 and formatting as General (ie 3:30 becomes 3.5, -0:30 becomes -0.5 etc)

    to

    c) storing values as Text and dummying the text string so as to closely resemble time format.


    Which you should use will largely depend on whether or not you need to do additional calculations with resulting values.

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.2.0