Formula Errors

Fix Excel SUM Formula Returning Zero for Time Durations

Huda QurayshiHuda Qurayshi Oct 16, 2026 870 views

Question details

The user needs to accurately calculate total time duration in days, hours, minutes, and seconds, but the SUM formula is failing.

How to Fix Excel SUM Formula Returning Zero for Time Durations
Product
Excel
Device & OS
not provided
Scenario
Attempting to sum up multiple individual time durations derived from subtracting start dates from end dates.
Observed behavior
The SUM function incorrectly returns 0 because the individual time difference results are formatted or stored as text strings rather than calculable numeric values.
Before you start

Check the alignment of your individual duration cells; if the values are aligned to the left by default, they are likely being stored as text which the SUM function cannot process.

Solution 1Recommended

Calculate Numeric Durations and Apply TEXT Formatting to the Total

Keep the source data as numeric values by performing a simple subtraction, and only apply text-based time formatting to the final SUM result.

The SUM function ignores cells containing text. If you format your individual time differences using the TEXT function right away, Excel treats them as text strings, resulting in a sum of zero. To fix this, you must retain the numeric date-time values in the individual rows and only format the final accumulated total.

1
Calculate raw date differences

In your individual duration cells, subtract the start date from the end date using a simple formula like =B2-A2. Do not wrap this formula in a TEXT function.

2
Format source cells as Number

Select these individual duration cells, right-click, choose 'Format Cells', and set their format to 'General' or 'Number' to ensure they remain numeric.

3
Calculate the sum of the durations

Click on the cell where you want the total to appear and enter the sum formula for your range, for example, =SUM(N6:N24).

4
Format the final total

Wrap your SUM formula in a TEXT function using bracketed time formats to display the accumulated days, hours, minutes, and seconds: =TEXT(SUM(N6:N24), "[d] days, [h] hours, [m] minutes, [s] seconds").

Calculate Numeric Durations and Apply TEXT Formatting to the Total
Why Use Brackets?: Using square brackets around the time units, such as [h] or [d], tells the spreadsheet application to accumulate the time instead of resetting it to zero after 24 hours or 31 days.
WPS Spreadsheet Solution

Calculate Time Durations Accurately with WPS Spreadsheet

WPS Spreadsheet is a powerful data analysis tool that natively supports complex date and time calculations, making it easy to sum elapsed times without formula errors.

  1. 1. Open your workbook: Launch WPS Spreadsheet and open the file containing your time calculations.
  2. 2. Verify numeric values: Ensure your date differences are calculated using a basic subtraction formula (e.g., =End_Date - Start_Date).
  3. 3. Apply the accumulated time formula: In your total cell, type =TEXT(SUM(Range), "[d] days, [h] hours, [m] minutes, [s] seconds") and hit Enter.
  4. 4. Review the correct total: WPS Spreadsheet will instantly calculate and display the total elapsed time in the correct format.
100% compatible with Microsoft Excel file formats (.xlsx) and functions.Accurately sum time durations without text-format errors using the exact same TEXT and SUM formulas.Completely free to download and lightweight on your system resources.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my SUM formula return 0 when adding times?

This happens when the time values are stored as text strings rather than numeric values. The SUM function only adds numbers and ignores text, which results in a total of 0.

How do I convert text times to numeric times so they can be summed?

You can convert text-based numbers into actual numbers by using the VALUE() function, or by typing a 1 in an empty cell, copying it, and using 'Paste Special > Multiply' over your range of text times.

What is the difference between "h" and "[h]" in time formats?

The standard "h" format displays the hour of the day and resets to 0 after 24 hours. The bracketed "[h]" format represents elapsed time, allowing the hours to accumulate past 24 (e.g., 25 hours, 40 hours).