Xlookup to Find a Value in 2 Columns

CF64

New Member
Joined
Feb 17, 2021
Messages
48
Office Version
  1. 365
Platform
  1. Windows
Hello,
Is there a way to look in multiple columns for a value using xlookup?

Example:
Worksheet 1
AB
Unique_IDReturn_Value (xlookup formulat goes in this column)
abc123orange
def123apple


Worksheet 2
ABC
Unique_ID_1Unique_ID_2Value
abc123efg345orange
cde123def123apple
bc3123lmn999grapes


In worksheet 1, I would like to find the unique ID in column A in worksheet 2 columns A or B and return the value in worksheet 2 column C
So,
lookup 'abc123' in columns A and B of worksheet 2 and return Orange
lookup 'def123' in columns A and B of worksheet 2 and return apple

Thank you for your consideration
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
How about
Excel Formula:
=XLOOKUP(A2,Sheet2!$A$2:$A$100,Sheet2!$C$2:$C$100,XLOOKUP(A2,Sheet2!$B$2:$B$100,Sheet2!$C$2:$C$100,""))
 
Upvote 0
Solution
Awesome, thank you! and thank you for the fast reply!
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,128
Messages
6,123,206
Members
449,090
Latest member
bes000

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top