I am using the following formula for a workday calculation where GB bank holidays are listed in sheet 'Bank Holidays' cell range B13:Z13.
=IF(F2<E2,IF(L2="GB",WORKDAY(E2,2,'Bank Holidays'!B13:Z13)),IF(L2="GB",WORKDAY(F2,2,'Bank Holidays'!B13:Z13)))
In the 'Bank Holidays' sheet I have 31 countries bank holidays listed across rows, column A has the list Country codes, columns B to Z have the holiday dates.
In my active worksheet ('ALL Data') I have rows of orders shipments including the country code (column L).
What I would like to do is when calculating the workday I want to exclude the holiday relevant to the country code.
In effect I need to do a vlookup using the country code on sheet 'ALL Data' Column L to the holiday days listed against the same country code on sheet 'Bank Holidays' column A.
But vlookup only returns the first value found. Is there a type of vlookup that will return all the dates against the relevant country code (range: column B:Z).
I believe an index match would work but, I'm not familiar with this and I cannot get this to work.
=WORKDAY(MAX(E2,F2),2,INDEX('Bank Holidays'!B:Z,MATCH(L2,'Bank Holidays'!A:A,0)))
– Dirk Reichel