Fix Excel SUM Formula Returning Zero for Time Durations
Question details
The user needs to accurately calculate total time duration in days, hours, minutes, and seconds, but the SUM formula is failing.

- 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.
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.
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.
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.
Select these individual duration cells, right-click, choose 'Format Cells', and set their format to 'General' or 'Number' to ensure they remain numeric.
Click on the cell where you want the total to appear and enter the sum formula for your range, for example, =SUM(N6:N24).
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 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. Open your workbook: Launch WPS Spreadsheet and open the file containing your time calculations.
- 2. Verify numeric values: Ensure your date differences are calculated using a basic subtraction formula (e.g., =End_Date - Start_Date).
- 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. Review the correct total: WPS Spreadsheet will instantly calculate and display the total elapsed time in the correct format.

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




