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
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
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
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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