=IF(ISERROR(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,3,FALSE)),
IF(ISERROR(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,4,FALSE)),
"Not found",""),"")
[....]
Need it to return the value found in col 3, or col 4
if found (in that order). If it's not in either of those
columns, need a 'Not Found" returned.
Sorry: which crafting an "improved" solution, which I deleted from
Google Groups but others will see in other news archives, I realized
that I misread your original request in the first place.
I would suggest that you do the VLOOKUPs in helper cells to limit the
number of VLOOKUPs to 2.
In XL2007 and XL2010, the following one-liner results in 2 to 3
lookups.
=IFERROR(IF(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,3,FALSE)<>"",
VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,3,FALSE),
IF(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,4,FALSE)<>"",
VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,4,FALSE),"Not found")),"Not found")
In XL2003, the following one-liner results in 3 to 4 lookups:
=IF(ISERROR(MATCH(16618,A1:A21,0)),"Not found",
IF(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,3,FALSE)<>"",
VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,3,FALSE),
IF(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,4,FALSE)<>"",
VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,4,FALSE),"Not found")))
If you are assured that 16618 is in A1:A21, you can use the same
shortened formula in all Excel versions:
=IF(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,3,FALSE)<>"",
VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,3,FALSE),
IF(VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,4,FALSE)<>"",
VLOOKUP(16618,A1
![Big Grin :D :D](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
21,4,FALSE),"Not found"))