Calcualting hours

C

Charles Bostic

Please help create a formula to calculate total hours serviced for a technician who conducts a service call, which takes him 3 days to complete. If the start date is 10/20/2009 10:00 a.m. and the service is completed on 10/22/2009 12:00 p.m., I would like to collect the total hours in house minus the hours the shop was closed, which is from 5 p.m. to 9 the next morning. The results should be approx. 18 hours of service.

EggHeadCafe - Software Developer Portal of Choice
CSV Reader in C#
http://www.eggheadcafe.com/tutorial...d-433d-80a2-35aedb65ad39/csv-reader-in-c.aspx
 
D

David Biddulph

Why the N() function, Bob?
--
David Biddulph

Bob Phillips said:
Try

=N((INT(A11)-INT(A10)+1)*8-MAX(HOUR(A10)-9,0)-MAX(17-HOUR(A11),0))

--
__________________________________
HTH

Bob
 
M

Mike H

Charles,

Try this one which will do part hours and has an additional field for
Holidays. If you use it create a named range called 'Holidays' and enter the
dates of any days you want to exclude.

It rurns decial hours/minutes if formatted as general. Remove the *24 from
the end and format as [h]:mm to get time.

=((NETWORKDAYS(A1,B1,Holidays)-1)*("17:00"-"09:00")+MOD(B1,1)-MOD(A1,1))*24



Mike
 
B

Bob Phillips

That was to force it into a number, otherwise it returned the result as a
timestamp.
 
B

Bob Phillips

I find that even when it is General, Excel in its infinite wisdom reformats
it. I can format afterwarsd, but I end up doing it so often; N() works for
me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top