Thursday, July 3, 2014

Calculate Time in Excel

The simple way to calculate the time is sum the two time inputs, shown in below example:

Use Excel built-in function SUM to calculate. Use same as you calculate any number:
Below mention three cells A1, A2 and A3 formatted as time (hh:mm)

A1 = 04:15
A2 = 10:15
A3 has the formula: =SUM(A1:A2)

then A3 will have the correct values of 14:30.

This is only useful until total is below 24 hours, but if your total times are greater than 24 hours then things get different, it will round the calculation and start from beginning and you won't get correct answer.

e.g.: If you have :
A1 = 15:30 and A2 = 10:15 then A3 will have 01:45 instead of 25:45. I.e. any hours beyond 24 hours are dropped.

To retain the hours beyond 24, you have two alternatives:

1. If you want to convert the hours beyond 24 into days then use this cell format : dd:hh:mm. The total in the previous example will be 01:01:45 (1 day , 1 hour and 45 minutes)

2. If you want to keep the hours beyond 24 as is then use this cell format :[h]:mm. The total in the previous example will be 25:45.

In both cases the formula will remain as it is. Only the cell format differs.