How do I format a Google Sheets duration formatted cell to show days, hours and minutes in a human readable format?

Viewed 4146

The cell I have in Google Sheets currently shows the difference in time between two date-times, the cell is formatted as a duration and displays as a colon separated value in hours, minutes and seconds.

Example below.

788:42:07

How do I format the cell to be more human readable, specifically in the format that shows the days, hours and minutes of the duration with each numeric value labelled appropriately?

2 Answers

The solution I found to be effective was writing a formula the converted the existing duration value into the individual duration component values of days, hours and minutes and then concatenates these values with strings that label the values appropriately.

The formula is as follows:

=int(B4)&" days "&hour(mod(B4,1))&" hours "&minute(mod(B4,1))&" minutes"

with B4 being the duration formatted cell containing the value

788:42:07

The cell containing the solution formula now displays the duration cell information as follows:

32 days 20 hours 42 minutes


I found the following resources useful in discovering the solution to this question.

https://infoinspired.com/google-docs/spreadsheet/convert-time-duration-to-day-hour-minute-in-google-sheets/

Google Sheets INT formula documentation

Google Sheets MOD formula documentation

Google Sheets HOUR formula documentation

Google Sheets TEXT formula documentation

try:

=QUOTIENT(TEXT(A1, "[hh]")/24, 1)&"d "&TEXT(MOD(VALUE(A1), 1), "hh:mm")

enter image description here

0

Related