View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default difference of date/time only calculating workingdays/hours

Bob,

I see your pont about the times, I assumed that the OP's times would be
within the working day and perhaps I should have pointed that out. I can't
see the issue with A1 or B1 being a weekend date

03/01/2009 08:00 05/01/2009 12:00

The formula evaluates as 4 for these 2 date/time for examples. What am I
missing?

Mike



"Bob Phillips" wrote:

What if A1 or B1 is a weekend date, or a holiday?

Or the time is outside of those working hours?

--
__________________________________
HTH

Bob

"Mike H" wrote in message
...
Susanne,

Try this. It assumes you working day is 08:00 - 16:00 hrs so change to
suit.
Format
the cell as [hh]:mm

Holidays is a named range that contains holiday dates. If you don't want
this simply delete ',holidays' form the formula

=(NETWORKDAYS(A1,B1,Holidays)-1)*("16:00"-"08:00")+MOD(B1,1)-MOD(A1,1)

Mike


"Susanne" wrote:

Can you please help me. I need to calculate the difference between two
dates
which also contain the timestamp but I would like it to only count the
normal
working time - 8 hours per day and not weekends