What I meant re: LOOKUP is this - if we assume the value being returned by the various VLOOKUPs is always a number (if successful) then you can avoid the double evaluation:
Note how the VLOOKUPs are now listed in reverse order.
This is because the LOOKUP construct (as used here) will return the last number found in the 4 value array.
As such you want the most desired result listed last and least desired listed first.
The key difference between the two approaches (embedded IF with double evaluation and LOOKUP) is that all 3 VLOOKUPs are performed at all times in the LOOKUP approach (though each is performed once only)
This is the point I alluded to regards whether or not the majority of your VLOOKUP1 tests will be successful ?
If they are then given the present embedded IF approach you're only performing 2 VLOOKUPs, using the LOOKUP you're performing 3.
Conversely if you expect the majority of VLOOKUP1 tests to fail then the above is likely to prove more efficient.
This is because a VLOOKUP1 failure would result in at least 3 VLOOKUPs being performed via the embedded IF route (VLOOKUP1, VLOOKUP2*2).
Should VLOOKUP2 also fail then you're performing 5 VLOOKUPs using the embedded IF route (VLOOKUP1, VLOOKUP2*2, VLOOKUP3*2)
The downside to the LOOKUP is that if each VLOOKUP returns more than one data type (ie numbers and strings) then it won't work.
Bookmarks