View Single Post
  #6   Report Post  
Ron Rosenfeld
 
Posts: n/a
Default

On Tue, 25 Jan 2005 11:46:09 -0500, "Ken Ivins" wrote:

I am creating an employee time sheet that the put in their starting time and
ending time (From a drop down list). I would like Excel to calculate the
amount of time showing full and if need be a half hour. My problem is that
the results half only been in full hours. Such as 9 am to 5 pm comes out as
8 hours. But also 9 am to 4:30 pm also comes out as 7 hours instead of 7.5
hours.

I have tried three types of formulas with the same result:

=TEXT(F11-E11,"h")

=(INT(F10-E10*24))

=hour(f10-E10)

Any ideas on getting the results I need?

Thanks,
Ken


Assumption is that your times are entered as Excel times; eg. 9 AM; 4:30 PM;
etc.

If you wish to round to the nearest 30 minutes, then:

=ROUND((EndTime-StartTime)/TIME(0,30,0),0)*TIME(0,30,0)

If you wish to round up to the next 30 minutes, so that 7:01 -- 7:30, then

=CEILING(EndTime-StartTime,TIME(0,30,0))

and format as [h]:mm.

If you wish to convert either of the above to decimal numbers, then multiply
the result by 24:

=24 * ROUND((EndTime-StartTime)/TIME(0,30,0),0)*TIME(0,30,0)

or

=24 * CEILING(EndTime-StartTime,TIME(0,30,0))


--ron