# Solved: Excel if cell contains vlxp then put matching cell data in current cell

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

#### mariaa33

In cell j, I have formula =IF(SUMPRODUCT(ISNUMBER(SEARCH("VLXP",K2:AB2))+0)>=1,"Yes","No") that returns yes or no if VLXP is contained in any cell K2 through AB2 and it works correctly. What I would really like to do is then put into cell j the entire matching cell content or if not found return n/a. Is there a way to accomplish this maybe with VBA?

#### slurpee55

I think you can replace your formula with this:
=IF(ISERROR(INDEX(K2:AB2,MATCH("*VLXP*",K2:AB2,0))),"n/a",INDEX(K2:AB2,MATCH("*VLXP*",K2:AB2,0)))

#### slurpee55

Let's make that easier to read:
Code:
``=IF(ISERROR(INDEX(K2:AB2,MATCH("*VLXP*",K2:AB2,0))),"n/a",INDEX(K2:AB2,MATCH("*VLXP*",K2:AB2,0)))``

#### mariaa33

Slurpee55, you are awesome! I have tried so many different combos of match and index with no luck. Thank you.

#### slurpee55

Your formula was pretty interesting because of some of the tricks you pulled on Excel - actually more complex than the Index/Match!
But very glad to help.

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

As Seen On

### Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

over 807,865 other people just like you!