+ Reply to Thread
Results 1 to 8 of 8

Calculating times when the end time could be before the start time

  1. #1
    Registered User
    Join Date
    10-19-2011
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    4

    Calculating times when the end time could be before the start time

    I am so lost and I have read so many forums. Is anybody able to help me?

    Basically, I am tracking the performance of a live production line. New dates and times are sent out twice a day every day. I need to track if the new loading times are going forward or backward. Of course the forward times are easy, I've read many forums but can't seem to narrow down how to read the negative value in hours as shown. The cell will need to read either the positive or negative value depending on the next updated schedule sent out. Please see attached picture for reference.

    Thanks so much
    Attached Images Attached Images

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Calculating times when the end time could be before the start time

    Hi Miko k and welcome to the forum,

    You can't display times that are negative, as you've discovered. But how about conditional formatting them to red of they should be neg? See the attached.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    10-19-2011
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Calculating times when the end time could be before the start time

    Quote Originally Posted by MarvinP View Post
    Hi Miko k and welcome to the forum,

    You can't display times that are negative, as you've discovered. But how about conditional formatting them to red of they should be neg? See the attached.
    Hi thanks for looking at my problem.

    It looks a bit there, but it is only counting the hours difference. If the line is say 25 hours behind, the calculation is only showing 1 hour behind.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Calculating times when the end time could be before the start time


  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating times when the end time could be before the start time

    You can display negative times if you use "1904 date system". You need to set that in a workbook before you put the dates in....otherwise the dates will change.....so in a blank workbook click on "Office" button at top left then

    Excel Options > Advanced > scroll down to "When calculating this workbook" > tick "1904 date system"

    Now copy in your dates....and you can use a simple subtraction formula, e.g. in C1

    =B1-A1

    custom format C1 as

    [h]:mm;[Red]([h]:mm);h:mm

    to show as required
    Audere est facere

  6. #6
    Registered User
    Join Date
    10-19-2011
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Calculating times when the end time could be before the start time

    Hi Sorry the first one still calcualtes out over 40,835 days and the second one isn't really what I need. Guess I have picked an interesting one to tackle.

  7. #7
    Registered User
    Join Date
    10-19-2011
    Location
    Calgary, Alberta
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Calculating times when the end time could be before the start time

    Quote Originally Posted by daddylonglegs View Post
    You can display negative times if you use "1904 date system". You need to set that in a workbook before you put the dates in....otherwise the dates will change.....so in a blank workbook click on "Office" button at top left then

    Excel Options > Advanced > scroll down to "When calculating this workbook" > tick "1904 date system"

    Now copy in your dates....and you can use a simple subtraction formula, e.g. in C1

    =B1-A1

    custom format C1 as

    [h]:mm;[Red]([h]:mm);h:mm

    to show as required
    Hi, I've tried the 1904 system, however it was converting all my dates to the year 2015 once I dump them in. But with a bit of format retweaking ideas from this forum and the year not actually being a necessary part of my needs, this would actually work out pretty good.. but once Feb 29 2012 hits, it adds one day to each formula. Ah the stress.
    Last edited by Miko K; 10-20-2011 at 12:41 PM.

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Calculating times when the end time could be before the start time

    OK, Yes that's a good point. You can convert the dates back to the correct ones. Put this number in a cell

    1461

    [that's the number of days that the dates change by]

    Copy that cell then select your range of dates > right click > Paste Special > Subtract > OK > ESC

+ 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