Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Exclude Holiday in existing Networkday code

Hi all   I have a code where I exclude the weekends to get the networkdays. Can someone help me to additional exclude the holidays which I want to set up in an excel file?   This is my existing c...
  • CNENFRNL's avatar
    CNENFRNL
    4 years ago
    (StartDate as date, EndDate as date) as number =>
    List.Count(List.Select(List.Dates(StartDate, Number.From(EndDate-StartDate) + 1, #duration(1, 0, 0, 0)), each Date.DayOfWeek(_, Day.Monday) < 5 or not List.Contains(Holidays, _)))