How to Fix the Wrong Subtotal Time:

I created a timesheet in MS Excel and wanted to show the total time I had worked. It worked great when it was just a few hours, but gave the wrong figure when I started accumulating more hours?

  • This was formatted as a decimal.
  • It showed a filtered subtotal, (a week’s worth of hours).
How to Sum Time in Excel (Over 24 Hours) - The Wrong Value (Example A)
The Wrong Value (example A)

Topics:


How to Fix the Subtotal Formula not Showing the Correct Result (Time):

The Cause:

When you format time in Excel it tends to format as hh:mm:ss. This formating works on the 24 hour clock. So, when you go past 24 hours, Excel is looking to start the clock again. This can cause the error.

Time is very often formatted as:

hh:mm:ss (or similar)

The image below gives an example:

How to Sum Time in Excel (Over 24 Hours) - The Wrong Formatting
The Wrong Formatting (For Over 24 Hrs)

Note:

  • To format a cell, right click the cell (or cells) and select ‘Format Cells…’

Using the wrong cell formatting can give you the wrong total value (sum):

How to Sum Time in Excel (Over 24 Hours) - The Wrong Value (Example B)
The Wrong Value (example B)

It may be confusing trying to find the error… Because if the total sum is less than 24 hours, the subtotal will appear to work?

How to Sum Time in Excel (Over 24 Hours) - The Wrong Formatting, But Shows Correct (Less Than 24 Hrs)
The Wrong Formatting, But Shows the Correct Value (Less Than 24 Hrs)

The Fix:

To get the correct ‘Total’ value when going above 24 Hrs, (using the formula =SUBTOTAL(function_num, ref1, …), we need to format the cell differently. To avoid the 24 hour formatting restriction of hh:mm:ss.

We can format the subtotal as:

[h]:mm;@

The image below gives an example:

How to Sum Time in Excel (Over 24 Hours) - The Correct Formatting
The Correct Formatting

We then get the correct subtotal value, for all the accumulated hours (above 24 Hrs) over periods of days, weeks, or more…

The Correct Value:

How to Sum Time in Excel (Over 24 Hours) - The Correct Value
The Correct Value

Hope this helps… Smiley


– click or tap the image to view full size –