Vlookup using one of two criteria

Zumas36

New Member
Joined
Nov 2, 2015
Messages
2
I have a sheet(1) with 3 columns, (ID number, employee number and employee name). On a separate sheet(2), I want to type out either the ID number or the employee number in column 1 and column two will yield the result of the employee name. I want to be able to do this for sheet(2) for an entire list of people who will fill in a register with either their ID or employee number to tracker attendance.
 
Last edited by a moderator:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
I have a sheet(1) with 3 columns, (ID number, employee number and employee name). On a separate sheet(2), I want to type out either the ID number or the employee number in column 1 and column two will yield the result of the employee name. I want to be able to do this for sheet(2) for an entire list of people who will fill in a register with either their ID or employee number to tracker attendance.
Please update your current version of excel and platform to give you an optimal solution.

You can use the link below 👇 in my signatures to update your account details.
 
Upvote 0
Try this...=XLOOKUP(E2,A:A,C:C,XLOOKUP(E2,B:B,C:C))

Let me know if this works. If I enter 1 or 2 its resulting in "me". same for 2 & 4 for You etc. The second Xlookup only kicks in if the first Xlookup fails.
1705942403033.png
 
Upvote 1
Solution

Forum statistics

Threads
1,215,094
Messages
6,123,071
Members
449,092
Latest member
ipruravindra

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