Calculating work hours

  • Thread starter Thread starter Dan
  • Start date Start date
D

Dan

I'm trying to calculate the total work hours between a start and end
date, and also working out an end date by adding a number of work
hours to a start date. Can anyone recommend a decent formula or
function that could do this?

For example, my working day starts at 09:00 til 17:30, with a lunch
break between 12:00 - 13:00. I work Monday to Friday.

How many working hours are there between 1st Oct 2007 15:00 to 4th
October 2007 11:30?

Also, what end date would i get if i added 35 working hours to the 1st
Oct 2007 15:00?

Anybody got any suggestions how i can calculate these values the most
efficiently?

Thanks in advance.

Dan
 
Dan said:
I'm trying to calculate the total work hours between a start and end
date, and also working out an end date by adding a number of work
hours to a start date. Can anyone recommend a decent formula or
function that could do this?

For example, my working day starts at 09:00 til 17:30, with a lunch
break between 12:00 - 13:00. I work Monday to Friday.

How many working hours are there between 1st Oct 2007 15:00 to 4th
October 2007 11:30?

Also, what end date would i get if i added 35 working hours to the
1st Oct 2007 15:00?

Anybody got any suggestions how i can calculate these values the
most efficiently?


That's what I get paid for usually. Why not take a sheet of paper, paint a
time line and deliberate the logic on your own?



Armin
 
Armin said:
That's what I get paid for usually. Why not take a sheet of paper, paint
a time line and deliberate the logic on your own?



Armin

I cant be of help with an easy calculation other than looping thru each
day and adding up the hours, but
Don't forge to handle Daylight Savings Time.
 
Dan said:
I'm trying to calculate the total work hours between a start and end
date, and also working out an end date by adding a number of work
hours to a start date. Can anyone recommend a decent formula or
function that could do this?

For example, my working day starts at 09:00 til 17:30, with a lunch
break between 12:00 - 13:00. I work Monday to Friday.

How many working hours are there between 1st Oct 2007 15:00 to 4th
October 2007 11:30?

Also, what end date would i get if i added 35 working hours to the 1st
Oct 2007 15:00?

Anybody got any suggestions how i can calculate these values the most
efficiently?

Thanks in advance.

Dan

A few For...Next loops and the DateAdd, DateDiff functions would be the way
to go IMHO.

Or you could encapsulate DateAdd and DateDiff in your own WorkdayDateAdd()
and WorkDayDateDiff() functions.
 
Back
Top