Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format a duration as HH:mm in the new Google sheets

In the new Google sheets there's a way of formatting a number as a duration. Format -> Number -> Duration.

  • 1 is formatted as 24:00:00
  • 1.2 is formatted as 28:48:00
  • 1.5 is formatted as 36:00:00
  • 0.03125 is formatted as 0:45:00.

I don't need the seconds in the duration representation, because they bloat my timesheet.

How can I format a duration as HH:mm (without using a formula to calculate hours and minutes and concatenate that with a colon). Is there a way of using the TEXT formula.

This is how I would like it:

  • 1 is formatted as 24:00
  • 1.2 is formatted as 28:48
  • 1.5 is formatted as 36:00 (I don't need 12:00 which datetime-formatting would accomplish)
  • 0.03125 is formatted as 0:45
like image 742
Christiaan Westerbeek Avatar asked Sep 07 '14 12:09

Christiaan Westerbeek


People also ask

How do I add HH MM to Google Sheets?

Hover the cursor over the Number option. Go to More formats and the click on Custom number format. In the Custom number formats dialog box, enter the following format: [hh]:mm:ss. Click on Apply.

How do I Format hours work in Google Sheets?

Select the “Hours Worked:” column. Click on the “123” drop-down menu item and choose “Duration” as the format. To activate the formula in the “Hours Worked” column, type “ =(C2-A2) ” where “C2” represents the “Time Out” cell, and “A2” represents the “Time In” cell.

How do I Format minutes and seconds in Google Sheets?

CHANGE SECONDS TO MINUTES AND HOURS IN GOOGLE SHEETS™Within the cell, type an equal sign (=) followed by the cell unit you want to convert. For example, if I want to convert seconds-to-minutes duration in the cell I2, I would type =I2. Divide =(cell) by 86400.


1 Answers

There is no need to use formulas for that, you can define your own custom formats.

Just go to Format -> Number -> More formats -> More date and time formats. It will open a window with several date and time formats to choose from. You can define your own as well, using the upper text area:

  1. Click on the small arrow on the left, and select the first element you want to add: elapsed hours. Notice there are two different "hours", one for time and another for durations.
  2. Type your separator text :
  3. Click on the arrow again and add the second element: Elapsed Minutes.
  4. Finally, click on each element you added, to determine the correct format (trailing zeros or not, for example).

Custom Date Format Screenshot

like image 67
AJPerez Avatar answered Nov 03 '22 21:11

AJPerez