Function NWD(start_date As Date, days As Integer, holidays As Range) Dim x As Integer x = 1 With Application.WorksheetFunction Do While x < days start_date = start_date + 1 If start_date Mod 7 <> 1 And .CountIf(holidays, start_date) = 0 Then x = x + 1 Loop End With NWD = start_date End Function
Function NWD(start_date As Date, days As Integer, holidays As Range) Dim x As Integer x = 1 With Application.WorksheetFunction Do While x < days start_date = start_date + 1 If start_date Mod 7 <> 1 And .CountIf(holidays, start_date) = 0 Then x = x + 1 Loop End With NWD = start_date End Function