[Fixed!] VALUE Error (#VALUE!) When Subtracting Time in Excel

We used a simple subtraction formula to get the difference between time data. The formula we have used is:

=C5-B5

4 Reasons with Solutions to VALUE Error When Subtracting Time in Excel


Reason 1 – Excel Returns the VALUE Error (#VALUE!) While Subtracting If Time is Stored as Text

When we type dates that do not match Excel’s date format, Excel stores those dates as text. When we try to subtract these types of dates from each other, excel returns the #VALUE error. If you type August 09 2021 in a cell, Excel will store the date as text.

Reason 1: Excel Returns VALUE Error While Subtracting If Time Stored as Text

Solution:

Type the dates in the correct format like 9-Aug-2021 (see screenshot).

Reason 1: Excel Returns VALUE Error While Subtracting If Time Stored as Text

Read More: How to Calculate Difference Between Two Times in Excel


Reason 2 – System Date and Time Settings Don’t Match Excel Cell Dates

We put a date in the Excel worksheet as mm-dd-yyyy. The PC date format is set as dd-mm-yyyy. The entered date in Excel is not in sync with the system Date and Time settings, which can cause Excel to store the value as text. We have put 01-23-2021 as the date, which doesn’t get registered as a date (since there’s no 23rd month in a year), so we can’t use it as a value.

Reason 2: System Date and Time Settings Is Not Similar to Excel Cell Dates

Solution:

Change the date types in Excel according to your system’s Date and time settings. We have changed the dates to the dd-mm-yyyy format.

Read More: How to Subtract Date and Time in Excel


Reason 3 – The Cell Contains Leading Spaces in Time Values

Entering a leading space before the date saves the value as a text. Trying to perform mathematical operations with those cells will return the #VALUE! error.

Reason 3: Excel Cell Contains Leading Spaces in Time Values

Solution:

Remove leading spaces.

Method 1:

  • Go to each cell and remove the space from the value manually.

Reason 3: Excel Cell Contains Leading Spaces in Time Values

Method 2:

  • Select the column data that contains leading spaces.
  • From the Excel Ribbon, go to Data and choose Text to Columns.

Reason 3: Excel Cell Contains Leading Spaces in Time Values

  • The Text to Column dialog will appear.
  • Choose Fixed width from Choose the file type that best describes your data.
  • Press Next and Next.

Reason 3: Excel Cell Contains Leading Spaces in Time Values

  • Choose Date from the Column data format and press Finish.

  • The selected cells will be converted to the Date format and you will get the expected time difference from the subtraction formula.

Read More: How to Subtract Time and Convert to Number in Excel


Reason 4 – VALUE Error (#VALUE!) When Subtracting Time from String in Excel

If you subtract a string from time, Excel will return #VALUE! error.

Reason 4: Excel Returns VALUE Error When Subtracting Time from String

Solution:

Put correct values in the cells you’re using in formulas.

Reason 4: Excel Returns VALUE Error When Subtracting Time from String

Read More: How to Calculate Time Difference in Numbers


Download the Practice Workbook


Related Articles


<< Go Back to Subtract Time |Calculate Time | Date-Time in Excel | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Hosne Ara
Hosne Ara

Hosne Ara is a materials and metallurgical engineer who loves exploring Excel and VBA programming. To her, programming is like a time-saving superhero for dealing with data, files, and the internet. She's skilled in Rhino3D, Maxsurf C++, MS Office, AutoCAD, and Excel & VBA, going beyond the basics. With a B. Sc. in Materials and Metallurgical Engineering from Bangladesh University of Engineering and Technology, she's shifted gears and now works as a content developer. In this role, she... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo