View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.newusers
Bernard Liengme Bernard Liengme is offline
external usenet poster
 
Posts: 4,393
Default days calculation

Here is the code
Function workdays(firstday, lastday, holidays)
workdays = WorksheetFunction.NetworkDays(firstday, lastday, holidays)
End Function

called with =workdays(a1,b1,d1:5) where A1 has the first day, B1 the last
day and D1:D5 a list of holiday dates

Not bothered by holidays?
Function workdays(firstday, lastday)
workdays = WorksheetFunction.NetworkDays(firstday, lastday)
End Function
called with =workdays(a1,b1,d1:5) where A1 has the first day, B1 the last
day

best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Yousoft" wrote in message
...

I mean that I want this formula in UDF form.
"Bernard Liengme" wrote:

Have a look in Help at NETWORKDAYS
best wishes
--
Bernard V Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme
remove caps from email

"Yousoft" wrote in message
...
Hi All
The following formula is calculating the no of days without holidays,
so I
want this formula in excel function way.
=SUMPRODUCT(INT((D5-C5+WEEKDAY(C5-{1,2,3,4,5}))/7))