Problem
We'd like to convert a time value to a decimal number in Excel. For instance hours:minutes:seconds (hh:mm:ss) to a decimal number Excel.
Solution
We multiply the time value by the corresponding factor.
- To hours: multiply the time value by 24, total hours in a day.
- To minutes: multiply the time value by 1,440, total minutes in a day (24*60).
- To seconds: multiply the time value by 86,400 total seconds in a day (24*60*60).
Alternative
Using the function CONVERT to convert between time units.
- To hours: =CONVERT(B4,"day","hr").
- To minutes: =CONVERT(B4,"day","mn").
- To seconds: =CONVERT(B4,"day","sec").
Notes
To properly format the cells, select the cells you need to format and press CTRL+1 and choose the format you want.
No hay comentarios:
Publicar un comentario