Hours Calculation

Gichiguy

New Member
Joined
Aug 31, 2002
Messages
1
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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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,

Paddy
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,037
Members
448,543
Latest member
MartinLarkin

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top