+ Reply to Thread
Results 1 to 6 of 6

Vlookup with '-' in lookup Cell

  1. #1
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Question Vlookup with '-' in lookup Cell

    Hi,

    Can anybody help with following problem?

    I have in a cell the e.g. value: 1542-D14
    But the Vlookup Function gives me an error, because he can't find it.

    The lookup values could be a regular number with 7numbers e.g. 8002548 or 8 digits with a dash and a letter in it e.g. 1541-D13

    So I want a formular that shows me a "No" in case I find my looked up value and a "Yes" in case it can't find the value.

    =IF(VLOOKUP(G436;$G$374:$G$422;1;FALSE); "No"; "Yes")

    This is what I have, but it's only giving me the 'No' for the 7 digits numbers in case Excel can find the value in my lookup range.

    Cheers,
    Marianne

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Vlookup with '-' in lookup Cell

    Try

    =IF(ISNA(MATCH(G436;$G$374:$G$422;0));"Yes";"No")

  3. #3
    Valued Forum Contributor
    Join Date
    01-19-2012
    Location
    Barrington, IL
    MS-Off Ver
    Excel 2007/2010
    Posts
    1,211

    Re: Vlookup with '-' in lookup Cell

    Vlookup can only return a looked up value, not whether a value is found or not. You need to use an IF(ISERROR to do this.


    Try

    =IF(ISERROR(VLOOKUP_FORMULA),"Not Found","Found")

    Alternately, you can use a match function as well which may be preferred.

    =IF(ISERROR(MATCH(Lookup_value,Column_or_row,0),"Not Found","Found")

    Hope this helps.
    You should hit F5, because chances are I've edited this post at least 5 times.
    Example of Array Formulas
    Quote Originally Posted by Jacc View Post
    Sorry, your description makes no sense. I just made some formula that looks interesting cause I had nothing else to do.
    Click the * below on any post that helped you.

  4. #4
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Vlookup with '-' in lookup Cell

    Hi,

    another approach using COUNTIF


    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  5. #5
    Registered User
    Join Date
    03-20-2012
    Location
    Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    39

    Re: Vlookup with '-' in lookup Cell

    OMG - thanks Jonmo1! This is fantastic! Thanks a lot!

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Vlookup with '-' in lookup Cell

    You're welcome..

    FYI, if a TRUE or FALSE result is sufficent instead of Yes or No, you can just do

    =ISNA(MATCH(G436;$G$374:$G$422;0))

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to use vlookup if value of lookup cell is same in lookup range
    By anujteetwal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2014, 05:15 AM
  2. [SOLVED] VLOOKUP Error when lookup value references a cell that is a sum.
    By Joeg101 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 05-31-2013, 01:36 PM
  3. Use vlookup to lookup cell comments
    By clintwade in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 12-04-2011, 04:11 PM
  4. Replies: 1
    Last Post: 10-07-2010, 10:19 PM
  5. Vlookup:keep cell reference as lookup criteria
    By somesoldiers in forum Excel General
    Replies: 2
    Last Post: 01-07-2010, 07:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1