Hi All,
I have a networkdays formula like below
Networkdays(d1,d2,holidaylist1)
where holidaylist1 is a defined array constant
My problem is I want different lists to be selected based on the input I select in another cell
For example
If I select say location1 in Cell 1 the formula should modify to
Networkdays(d1,d2,holidaylist1)
If I select location2 then the forumla should be Networkdays(d1,d2,holidaylist2)
and so on
Can someone help me out with this ? Thanks
Using Variables in Networkdays



Re: Using Variables in Networkdays
Are you calling Networkdays from VBA or as a formula in Excel?

Re: Using Variables in Networkdays
Am doing this using Excel formulas and not using VBA
I tried a few approaches like using an IF condition to use different formulas but the problem there is the formula exceeds the 255 char limit when I use it (the networkdays function used above is a small part of the formula) 
Re: Using Variables in Networkdays
Try:
NETWORKDAYS(D1,D2,IF(C1="location1",INDIRECT("holidaylist1"),INDIRECT("holidaylist2")))
Where C1 is the reference to your 'Cell 1' where you select your location. 
Re: Using Variables in Networkdays
Thank you so very much ! That worked brilliantly

Participate now!
Don’t have an account yet? Register yourself now and be a part of our community!