# Hours Calculation

#### Gichiguy

##### New Member
I'm learning but I'm Stuck.
Time calculation :

1st cell 2nd cell
15:30 1:45 (10:25)

It is 10.25 hrs from 3:30pm to 1:45 am

Lee

### Excel Facts

Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
On 2002-09-01 17:06, Gichiguy wrote:
I'm learning but I'm Stuck.
Time calculation :
<pre>

1st cell 2nd cell
15:30 1:45 (10:25)

</pre>
It is 10.25 hrs from 3:30pm to 1:45 am

Hi - welcome to the board.

You've run up against some of the quirks of how excel stores dates & times (so - first step = read up on the help file for 'how excel stores dates & times' !).

Times are:

1) stored as decimal fractions of days, so 12 hours = 0.5, one hour = 0.04 etc.
2) Date values are stored as numbers from 01 Jan1900 - 021 Jan 900 = 1, 02 Jan 1900 = 2 etc
3) times entered without a date are assumed by excel to have a date value of 0.
so,
4) entering 15:30 will give you a date-time value of 0/01/1900 15:30:00; 01:45 will give you a date-time value of 0/01/1900 01:45:00 - hence your calculation falling over.

To fix this, you need to get excel to recognise that the second time is after the first. Use a formula of the form:

=IF(A1>B1,B1+1-A1,B1-A1)

where a1 is start time & b1 is end.

You will also need to format your cell as [hh]:mm, which is the format for elapsed time calculations

also, you could check out

http://www.mvps.org/dmcritchie/excel/datetime.htm

which has loads of info re dates & times in excel.

Hope this helps,

Replies
1
Views
304
Replies
2
Views
86
Replies
2
Views
156
Replies
1
Views
585
Replies
6
Views
198

1,221,417
Messages
6,159,787
Members
451,589
Latest member
Harold14

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back