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

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

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,118,661
Messages
5,573,477
Members
412,532
Latest member
crazzyapple
Top