You can use whole columns in formulae too. This performs the VLOOKUP on the whole of columns A & B on sheet3:
=VLOOKUP(Sheet2!A2,Sheet3!A:B,2,FALSE)
If you'd rather, select those two columns and name them (e.g. Cust_PCodes), then you can use the name in the formula:
=VLOOKUP(Sheet2!A2,Cust_PCodes,2,FALSE)
Use IF(ISBLANK(...)...) to decide whether or not to use Sheet 3:
=(IF(ISBLANK(Sheet1!B2),VLOOKUP(Sheet2!A2,Sheet3!A:B,2,FALSE),Sheet1!B2)
And finally, convert the answer to upper case for the postcode...
=UPPER(IF(ISBLANK(Sheet1!B2),VLOOKUP(Sheet2!A2,Sheet3!A:B,2,FALSE),Sheet1!B2))
Bookmarks