Combining two Xlookup function

ammykhan

Board Regular
Joined
Apr 23, 2022
Messages
55
Office Version
  1. 2021
Platform
  1. Windows
Hey All friends👋,

Can I get suggestion how to combine two lookup functions, I have a situation where I have to lookup customer data using their employee id but some customer forgets to give their details in such a scenario I need to filter the data by making use of their name instead. Want to make a combined formula to filter data by using either their Name or Employee Id, is there a way to combine two lookup functions for keeping our Excel sheet simple. The formula I'm trying to build shall be more or less like the one below.

=OR(XLOOKUP($D2,Staff_no, Location), XLOOKUP($D2,Name, Location)

Any advice from my senior fellows will be highly appreciated so I can further my insight in MS Excel, thanks in advance ☺️
 
Something like this then?

my_checklist01 (1).xlsx
ABCD
1Location MailboxNameID
2DSO4251259532
3DSO4928IL SUK
4MS7572JI Hyun
5GHD4470268845
6OBD7693378485
7GHD10267jin lee
8Sarab11808na rae
CC
Cell Formulas
RangeFormula
A2:A8A2=XLOOKUP(D2,Staff_No,Location,XLOOKUP(C2,Name,Location))
B2:B8B2=XLOOKUP(D2,Staff_No,Mail,XLOOKUP(C2,Name,Mail))
Named Ranges
NameRefers ToCells
Location='Main Sheet'!$D$2:$D$20A2:A8
Mail='Main Sheet'!$C$2:$C$20B2:B8
Name='Main Sheet'!$B$2:$B$20A2:B8
Staff_No='Main Sheet'!$A$2:$A$20A2:B8
Hi Sir, Please your insight helped make get my desired result with minimal fuss but now we are regularly updating our Main Sheet , my actual sheet is like Screenshot(1) without any error but after updating the data I'm getting a '0' error and the column NNN isn't returning anything unless in the adjacent column I have typed something as can be seen in Screenshot(2), pls can you suggest me what I can do while updating my workbook, thanks a lot for being helpful.
 

Attachments

  • Screenshot (1).png
    Screenshot (1).png
    153.5 KB · Views: 4
  • Screenshot (2).png
    Screenshot (2).png
    173 KB · Views: 4
Upvote 0

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Forum statistics

Threads
1,220,965
Messages
6,157,119
Members
451,398
Latest member
rjsteward

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