I have 2 excel spreadsheets, sheet 1 and sheet 2:
Sheet 2
Col F (Date) Col G (Item No) Col H (Supplier code) Col I (PO Number)
21/12/2016 12345 123 PO1111
18/12/2016 5555 2468 PO2222
123 po982
Sheet 1
Column F (Week No or date) Column G (Item No) Col H (Supplier Col I (Formula) Code)
51 12345 123
18/12/2016 5555 2468
In Column I on sheet 1, i want to add my index match formula:
=INDEX(Sheet2!D1, MATCH(F4&G4&H4,Sheet2!A:A&Sheet2!B:B&Sheet2!C:C, 0))
This should return the PO number from column I on sheet 2 where column F, G and H match.
This works fine. And from the example above, this formula would return a result for the last row:
18/12/2016 5555 2468 PO2222
You might have noticed that the first row in column (F) on sheet 1 has a week number 50 - yet there is a date of 21/12/2016 in column F on sheet 2.
By rights this would not give a matching result.
However, Column F on sheet 2 will either have a week number or a specific date in it. And if this is the case, i want my formula to check for both a matching date or where a matching date is not found, check if the date falls within that week number? So for instance 21/12/2016 would fall into week 51 (week beginning monday).
Is there a way i can amend my index match formula accordingly to get this result?
Thanks in advance
= WEEKNUM(F2)
– nightcrawler23