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
3 replies
Sort By: 

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


Reply

Mar 1, 2025 5:32 PM in response to motojoe00

Assuming the cell value is something that Numbers can interpret as a duration, use the Cell Format inspector:



Set the Cell Format to Duration, then under Custom Units you can choose which units (weeks, days, hours, minutes, seconds, milliseconds) to display.

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)

Reply

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.