Home > Blockchain >  Convert HH:MM values to H in the same column
Convert HH:MM values to H in the same column

Time:01-27

Is there a way for me to format a column where the values I enter in the format HH:MM (elapsed time, not datetime) are converted to hours in decimal, preferably in the same column via some custom formula?

For example,

HH:MM H (Decimal)
07:39 7.65
02:15 2.25
06:00 6

At the moment, I manually calculate the equivalent and enter them into the column but it would be nice to directly copy a timestamp and have the column automatically format it but I couldn't see an option for this in Date/Time formatting settings.

CodePudding user response:

Simply multiply your hh:mm durations by 24, ensuring that the cells where you want the decimal hours returned are formatted as 'Number'. Or to force formatting as a number using a formula: =text(duration_cell*24,"#.##") where duration_cell is a cell with the duration in hh:mm format.

CodePudding user response:

You can aply this formula: =HORA(A2) (MINUTO(A2)/60)

enter image description here

CodePudding user response:

All date and time is a format of a double value. Time is the amount after the comma. And all in front of comma is days since 00.01.1900.

Meaning 07:37:00 = 0,32 days.

Excel have a ways to pull the amount of hours with =HOUR('Your referance date time cell value')

  • Related