VLOOKUP Query

  • Thread starter Thread starter blain
  • Start date Start date
B

blain

Is it possible to set up a VLOOKUP that works something like this?

Enter value in sheet1!A1

check this value in sheet2!A:B

If value is found in A return value in B to sheet1!A2
If value is found in B return value in A to sheet1!A2
 
For the first case you can use VLOOKUP:
=VLOOKUP(A1,Sheet2!A:B,2,FALSE)
For the second INDEX and MATCH
=INDEX(Sheet2!A:A,MATCH(A1,Sheet2!B:B,0))
You can combine the two in a single formula, with some error control, like:
=IF(ISNA(VLOOKUP(A1,Sheet2!A:B,2,FALSE)),IF(ISNA(MATCH(A1,Sheet2!B:B,0)),"Not
present",INDEX(Sheet2!A:A,MATCH(A1,Sheet2!B:B,0))),VLOOKUP(A1,Sheet2!A:B,2,FALSE))

Hope this helps,
Miguel.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top