0

I have a cell that I would like to format as follows (and with the desired values):

3:15 / 48:00 (-44:45)

Here is what I have tried (attempting to the use the TEXT function):

=text(sum(B4:4)*24,"hh:mm")&" / "&text(sum(B1:1),"hh:mm")&" ("&text( (sum(B4:4)*24)-sum(B1:1),"hh:mm" )&")"

However that gives an output of:

06:00 / 00:00 (06:00)—the numbers are quizically wrong!

Please see my reference sheet here.

1 Answer 1

1

You need to format row 1 as Format > Number > Duration.

To format an elapsed time as duration properly, use the [h] pattern in text(), like this:

=text(sum(B4:4), "[h]:mm") & " / "& text(sum(B1:1), "[h]:mm") & " (" & text(sum(B4:4) - sum(B1:1), "[h]:mm") & ")"

See the sample spreadsheet and Working with date and time values in Google Sheets.

3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.