1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

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

Discussion in 'Business Applications' started by mariaa33, Sep 10, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. mariaa33

    mariaa33 Thread Starter

    Joined:
    Aug 7, 2008
    Messages:
    164
    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?
     
  2. slurpee55

    slurpee55

    Joined:
    Oct 20, 2004
    Messages:
    7,837
    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)))
     
  3. slurpee55

    slurpee55

    Joined:
    Oct 20, 2004
    Messages:
    7,837
    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)))
     
  4. mariaa33

    mariaa33 Thread Starter

    Joined:
    Aug 7, 2008
    Messages:
    164
    Slurpee55, you are awesome! I have tried so many different combos of match and index with no luck. Thank you.
     
  5. slurpee55

    slurpee55

    Joined:
    Oct 20, 2004
    Messages:
    7,837
    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. :)
     
  6. Sponsor

As Seen On
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.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/949099

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice