Networkdays equivalent for minutes

J

Jon Ratzel

I'm trying to calculate the number of minutes between two dates and times but
I want the calculation to consider only the work day of 8:30AM to 5:00PM. So
if cell A1 has 12/13/07 4:59 PM and cell B1 has 12/14/07 8:30 AM, I need cell
C1 to calculate an answer of 00:01:00 (when formatted as HH:MM:SEC) and not
the 15:31:00 that I would get if I simply subtracted B1 from A1. The tricky
part is that I have weekends that I need to account for as well. Any
suggestions?
 
B

Bob Phillips

=NETWORKDAYS(A1,B1)-2+((WEEKDAY(A1,2)<6)*(MAX(0,TIME(17,0,0)-MOD(A1,1))))-((WEEKDAY(A1,2)<6)*(MAX(0,TIME(8,30,0)-MOD(A1,1))))
+((WEEKDAY(B1,2)<6)*(MAX(0,MOD(B1,1)-TIME(8,30,0))))-((WEEKDAY(B1,2)<6)*(MAX(0,MOD(B1,1)-TIME(17,0,0))))

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)
 

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