Sum of durations

How can I add the column of durations

Posted on May 27, 2020 4:59 PM

Reply
Question marked as Top-ranking reply

Posted on May 27, 2020 10:08 PM

Durations can be summed with SUM just like number values.



However, all values to be summed must be duration values. Your issue is that rows with no duration values result 0.0, formatted as a numerical value.



There are two workarounds for this. The simple way would be to select the whole column and change the data format to duration. 0.0 will change to 0d, and your SUM formula will work.


The better way would be to replace these values with a null string. This would be done by adding an IF formula to each cell in the column. Assuming your duration column is Z, your current formula is presumably:


Z=Y-X


Change this to:


Z=IF(Y=“”,””,Y-X)


This will check to see if there is data in the “ending time” column and will only perform the subtraction if there is. Otherwise, the cell will appear empty. The actual contents will be a null string, represented as an empty set of quotation marks. These null strings will not interfere when you sum the column with SUM.


1 reply
Question marked as Top-ranking reply

May 27, 2020 10:08 PM in response to Jacobofnazareth

Durations can be summed with SUM just like number values.



However, all values to be summed must be duration values. Your issue is that rows with no duration values result 0.0, formatted as a numerical value.



There are two workarounds for this. The simple way would be to select the whole column and change the data format to duration. 0.0 will change to 0d, and your SUM formula will work.


The better way would be to replace these values with a null string. This would be done by adding an IF formula to each cell in the column. Assuming your duration column is Z, your current formula is presumably:


Z=Y-X


Change this to:


Z=IF(Y=“”,””,Y-X)


This will check to see if there is data in the “ending time” column and will only perform the subtraction if there is. Otherwise, the cell will appear empty. The actual contents will be a null string, represented as an empty set of quotation marks. These null strings will not interfere when you sum the column with SUM.


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.

Sum of durations

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