If then with lookup?

bellashahar

New Member
Joined
Nov 5, 2009
Messages
34
I think I am trying to do an IF THEN statement, but have a range of text to return if requirements are met. Could someone advise how this can be done?

Here is my example:

tab "Master Inventory" E2 is where I want to look and if it matchs my list in my lookup, I want it to return the text from tab "Lookup" (list to lookup is in A1-A22)

Hope this make sense. Any help would be appreciated.

thank you,
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
you should use a vlookup (vertical data) or hlookup (horizontal data)

=vlookup(E2,'lookup'!A1:A22,1,False)

The '1' is the cell in the row that you want to extract the data from. Modify it based on if you want it to pull another cell in that row.
 
Upvote 0
I think I am trying to do an IF THEN statement, but have a range of text to return if requirements are met. Could someone advise how this can be done?

Here is my example:

tab "Master Inventory" E2 is where I want to look and if it matchs my list in my lookup, I want it to return the text from tab "Lookup" (list to lookup is in A1-A22)

Hope this make sense. Any help would be appreciated.

thank you,

Hard to follow...

Does E2 on Master Inventory house a value that you want to match against (compare with) A1:A22 on Lookup? If so, what is the result range on Lookup?
 
Upvote 0
Yes, E2 has text that matches a portion of the list on my lookup.

For example, in E2 the cells have "12.2(31); in the lookup list I am looking for anything that has this 12.2(31) value. My list that I want to look at may look like this "Catalyst 4500 series 12.2(31)SG", so I want F2 to return the entire contents of my lookup if it has that portion on the data in it.

Does that make more sense?

thanks again for helping.
 
Upvote 0
Hello, Try any of these

=LOOKUP(1E+100,SEARCH(E2,$A$1:$A$22),$A$1:$A$22)

=VLOOKUP("*"&E2&"*",$A$1:$A$22,1,FALSE)

=INDEX($A$1:$A$22,MATCH("*"&E2&"*",$A$1:$A$22,0))
 
Upvote 0
Yes, E2 has text that matches a portion of the list on my lookup.

For example, in E2 the cells have "12.2(31); in the lookup list I am looking for anything that has this 12.2(31) value. My list that I want to look at may look like this "Catalyst 4500 series 12.2(31)SG", so I want F2 to return the entire contents of my lookup if it has that portion on the data in it.

Does that make more sense?

thanks again for helping.

Try in F2...

Either:
Code:
=INDEX(Lookup!$A$1:$A$22,MATCH("*"&E2&"*",Lookup!$A$1:$A$22,0))

Or:
Code:
=VLOOKUP("*"&E2&"*",Lookup!$A$1:$A$22,1,0)

To prevent #N/A for showing up...

If you are on Excel 2007 or later...
Code:
=IFERROR(INDEX(Lookup!$A$1:$A$22,
    MATCH("*"&E2&"*",Lookup!$A$1:$A$22,0)),"Not Found")

On all systems...
Code:
=IF(ISNUMBER(MATCH("*"&E2&"*",Lookup!$A$1:$A$22,0)),
   INDEX(Lookup!$A$1:$A$22,MATCH("*"&E2&"*",Lookup!$A$1:$A$22,0))
   "Not Found")
 
Upvote 0

Forum statistics

Threads
1,224,516
Messages
6,179,231
Members
452,898
Latest member
Capolavoro009

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