How can I get the SUM formula to output “0h 0m” or “0h” instead of just “0”

iPad Pro, iPadOS 18

Posted on Feb 28, 2025 9:03 PM

Reply
Question marked as Top-ranking reply

Posted on Mar 2, 2025 7:02 PM

If all the cells included in the SUM are empty, the sum will be the number 0 and you cannot format it as a duration. But you can include DURATION(0) in the SUM, or added to it, to force it to be a duration. Format the cell to show it as 0h. Or you can use DURATION(,,0) and use automatic formatting.


Examples:

=SUM(B6:O6,DURATION(0))

or

=DURATION(0)+SUM(B6:O6)

3 replies
Question marked as Top-ranking reply

Mar 2, 2025 7:02 PM in response to motojoe00

If all the cells included in the SUM are empty, the sum will be the number 0 and you cannot format it as a duration. But you can include DURATION(0) in the SUM, or added to it, to force it to be a duration. Format the cell to show it as 0h. Or you can use DURATION(,,0) and use automatic formatting.


Examples:

=SUM(B6:O6,DURATION(0))

or

=DURATION(0)+SUM(B6:O6)

Mar 1, 2025 8:09 AM in response to motojoe00

Not sure I follow the screenshots, but 0 indicates the cell contains a Number value while “0h 0m” and “0h” indicate that the cell contains a Duration value.


Durations (spans of time as opposed to a point in time) result from subtracting one Date & Time from another or by adding or subtracting a number (which Numbers interprets as days) to or from a Date & Time. Adding a Duration to a Duration also results in a Duration.


Durations can be input using w d h m ms shorthand.


Documentation on Number vs Duration data formats is terse, but worth a read:


Format dates, currency, and more in Numbers on Mac - Apple Support


SG


This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How can I get the SUM formula to output “0h 0m” or “0h” instead of just “0”

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.