Please Note: This article is written for users of the following Microsoft Excel versions: 97, 2000, 2002, and 2003. If you are using a later version (Excel 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Excel, click here: Displaying Negative Times.

Displaying Negative Times

Written by Allen Wyatt (last updated July 1, 2021)
This tip applies to Excel 97, 2000, 2002, and 2003


1

Mike has a worksheet that contains some times. If he subtracts 6:33 from 6:21 he noticed that he doesn't get a negative elapsed time, as in -:12. Instead he gets ############# in the cell. Mike is wondering how he can display the negative time difference properly?

The easiest way to solve this problem is to just change the date system used by the workbook. This may sound goofy, but if you use a 1900 date system (which is the default for Windows versions of Excel), then you get the ############# in the cell. If, instead, you change to the 1904 date system (which is the default for Mac versions of Excel) then you'll see the correct negative elapsed time in your formula.

To change the date system, follow these steps:

  1. Choose Options from the Tools menu. Excel displays the Options dialog box.
  2. Make sure the Calculation tab is selected. (See Figure 1.)
  3. Figure 1. The Calculation tab of the Options dialog box.

  4. The 1904 Date System check box controls which dating system is used. If the check box is not selected, then the 1900 dating system is used; if it is selected, then the 1904 system is used.

If you prefer to not change the dating system used in the workbook (perhaps it may mess up some other date formulas you have in the worksheet), then the only thing you can do is to create a text-based version of the time differential using a formula such as the following:

=IF(B2-A2<0, "-" & TEXT(ABS(B2-A2),"hh:mm"), B2-A2)

If the difference between the two time values (in A2 and B2) is negative, then the formula concatenates a text value consisting of the minus sign and the absolute value of the difference between the times.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (3514) applies to Microsoft Excel 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Excel (Excel 2007 and later) here: Displaying Negative Times.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Full Path Names in Excel

Need to know what the full path name is for the current workbook? With a simple macro you can display the full path name ...

Discover More

Setting a Document Naming Convention

Want your document file names to follow a specific naming convention? Word doesn't provide a direct way to set up your ...

Discover More

Insert a TOC without Upsetting Pagination

Insert a table of contents in your document, and your page numbering may get thrown for a loop. If you want the page ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (menu)

Macro for Month Name

Need to know how to generate a full month name based on a date? It's easy to do, as discussed in this tip.

Discover More

Setting a Default Date Format

Enter a date into a cell, and Excel allows you to format that date in a variety of ways. Don't see the date format you ...

Discover More

Finding the Previous Work Day

Excel has a number of functions that are available as an add-on in the Analysis ToolPak. One of these functions allows ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 5?

2017-03-21 11:28:17

Meg

In trying to set up a chart for shift work,
A1 = the time in (i.e.,7:30)
B1 = lunch break (i.e., 1:00)
C1 = shift ends (i.e., 16:30)
D1 = total time worked is 8:00
E1 needs to indicate how many hours was overtime, if any, and
F1 needs to indicate how many hours was under worked, if any.

Please help!


This Site

Got a version of Excel that uses the menu interface (Excel 97, Excel 2000, Excel 2002, or Excel 2003)? This site is for you! If you use a later version of Excel, visit our ExcelTips site focusing on the ribbon interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.