Xlookup to Find a Value in 2 Columns

CF64

Board Regular
Joined
Feb 17, 2021
Messages
50
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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
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,224,823
Messages
6,181,177
Members
453,021
Latest member
Justyna P

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