ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   days calculation (https://www.excelbanter.com/new-users-excel/209089-days-calculation.html)

Yousoft

days calculation
 
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))


Bernard Liengme

days calculation
 
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))




Yousoft

days calculation
 

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))





Bernard Liengme

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))








All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com