search options

wbfd25

New Member
Joined
Jun 12, 2013
Messages
21
is there a formula that would allow me to search a whole sheet from another sheet given 2 options but only one needs to be filled in. such as you could either searh by their last name or by their special code and the search will pull up the same information??? i currently have a vlookup formula running that searches another sheet given the special code i am wondering if there is a way to add in the las name option weather i have to insert a comma, or use the or function i am not quite sure where to go from here any help would be awesome thank you
 

Some videos you may like

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

Akashwani

Well-known Member
Joined
Mar 14, 2009
Messages
2,911
Hi,

There is probably a better way, but perhaps an IF formula would work for you.

Sample data and example result 1....

Excel Workbook
ABCDEFGHI
1IDFirst NameLast NameDataIDLast NameResult
2ID001MickeyMouseRedID005Black
3ID002DonaldDuckBlue
4ID003DonaldTrumpGreen
5ID004WillSmithYellow
6ID005WillyWonkaBlack
7ID006DavidBowiebrown
8ID007JamesBondGold
9
Sheet5


Sample data and example result 2....

Excel Workbook
ABCDEFGHI
1IDFirst NameLast NameDataIDLast NameResult
2ID001MickeyMouseRedTrumpGreen
3ID002DonaldDuckBlue
4ID003DonaldTrumpGreen
5ID004WillSmithYellow
6ID005WillyWonkaBlack
7ID006DavidBowiebrown
8ID007JamesBondGold
9
Sheet5


You will obviously have to add the relevant sheet name and cell references to suit your layout.

I hope that helps.

Ak
 

Watch MrExcel Video

Forum statistics

Threads
1,123,452
Messages
5,601,748
Members
414,471
Latest member
cchunyadi

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
Top