'Networkdays Function

Having a problem with the =NETWORKDAYS() function.

enter image description here

I would like to include two Holiday ranges - Holidays 1 and Holidays 2. The function seems to only allow for 1 range. Any ideas on how to get this to also include cell A2?

My current formula is =NETWORKDAYS(C2,D2,A2:A11).



Solution 1:[1]

Assuming Holidays1 and Holidays2 are both vertical ranges:

=NETWORKDAYS(C2,D2,CHOOSE({1,2},Holidays1,Holidays2))

If you're not using an English-language version of Excel then the separator for horizontal arrays, i.e. the comma in the part

{1,2}

may need amending.

A non-locale-dependent version, for those who have access to the SEQUENCE function:

=NETWORKDAYS(C2,D2,CHOOSE(SEQUENCE(,2),Holidays1,Holidays2))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Jos Woolley