Calculating number of workdays between 2 dates
On Fri, 21 Aug 2009 12:38:04 -0700, Gibbyky2
wrote:
here goes
i use excel 2007 and can calculate number of days between 2 dates using
networkdays function. but my colleagues use older versions of excel and
networkdays function does not work
i want to work out the example below as an example
1st date = 09/10/09
2nd date = 23/10/09
this equals 10 working days, i then want to be able to calculate the number
of days by 7.4 (average hours worked per day)
many thanks
I wonder how you obtain a result of 10 working days.
If I plug those dates into the NetWorkdays formula, I get 11 days. Are you not
counting the start or end date?
If you want a formula for earlier versions, similar to NetWorkdays, that also
includes the possibility of adding Holidays, you could use something like:
=SUMPRODUCT((WEEKDAY(ROW(INDIRECT(StartDate&":"&En dDate)),2)<6)*
ISNA(MATCH(ROW(INDIRECT(StartDate&":"&EndDate)),Ho lidays,0)))
Note that for the older versions of Excel, this formula will fail for dates
after about 5 June 2079
If you want to multiply this value by 7.4, then just:
=7.4*SUMPRODUCT((WEEKDAY(ROW(INDIRECT(StartDate&": "&EndDate)),2)<6)*
ISNA(MATCH(ROW(INDIRECT(StartDate&":"&EndDate)),Ho lidays,0)))
If you don't want to use the Holidays argument, then the second line above can
be replaced by a 1:
=SUMPRODUCT((WEEKDAY(ROW(INDIRECT(StartDate&":"&En dDate)),2)<6)*1)
Replace the Names in the formula above with Named ranges, or with the actual
range references.
--ron
|