Excel time calculation and formatting
Published:
It's actually really simple, but for some reason I just keep having to look up some of these... so... finally... note to self...
Formula | Example | |
---|---|---|
Calculations |
| 12:45 - 9:55 = 2:50 |
Time to decimal | =X*24 | 2:50 * 24 = 2.83 |
Decimal to time | =X/24 | 2,83 / 24 = 2:50 |
Days, hours, minutes | d h:mm | 11 19:20 |
Total hours and minutes | [h]:mm | 283:20 |
Total minutes | [m] | 17000 |
Regarding the formatting, without the brackets, it formats as regular time (total hours % 24
). So, for example, 2 hours and 50 minutes multiplied by 100:
- with a regular time format (
h:mm
) it displays as 19:20, - using brackets (
[h]:mm
) you get the correct 283:20, which is 11 days 19 hours and 20 minutes (hence the 19:20 fromh:mm
).
Some more examples
=B3-A3 | =C3*24 | =D2/24 | =E2*100 | d h:mm | [h]:mm | [m] | ||
---|---|---|---|---|---|---|---|---|
09:55 | 12:45 | 02:50 | 2,83 | 02:50 | 12:20 | 11 19:20 | 283:20 | 17000 |