+ Reply to Thread
Results 1 to 12 of 12

VLOOKUP Problem has me stumped

  1. #1
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    VLOOKUP Problem has me stumped

    I'm not getting expected result from this vlookup formula:

    Please Login or Register  to view this content.
    It is returning a value of "T1"


    The code is in worksheet CA_RR1_D cell BO9

    $A9 has value of 2 and since there is no value 2 IN COLUMN W i don't expect any value to be returned -

    Can I set a default value if the lookup criteria is not found?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    02-22-2013
    Location
    London, UK
    MS-Off Ver
    Office 365
    Posts
    1,218

    Re: VLOOKUP Problem has me stumped

    Try,

    =IFERROR(VLOOKUP($A9,CA_RR1_FINAL!$W$3:CA_RR1_FINAL!$X$46,2,FALSE),"no match")

    change the second parameter of iferror for the text/value to be returned if no match. Also added FALSE to the last parameter of vlookup to give a more exact match, if any.

  3. #3
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: VLOOKUP Problem has me stumped

    Quote Originally Posted by berlan View Post
    Try,

    =IFERROR(VLOOKUP($A9,CA_RR1_FINAL!$W$3:CA_RR1_FINAL!$X$46,2,FALSE),"no match")

    change the second parameter of iferror for the text/value to be returned if no match. Also added FALSE to the last parameter of vlookup to give a more exact match, if any.

    I tried the code changes but get back: #NAME? I suspect the IFERROR function is not available in excel 2003 because when I type =IFERROR( I don't get the usual syntax prompt as i normally get with a formula once I put in the left parenthesis.

    Thank you for your help - looks like that would have worked if I had a newer version of excel - Please let me know if you think of another solution - I do have a work around but it's not the most ideal - basically I do the vlookup and if it returns a value not equal to my search criteria I set a flag in another cell to say 'Drop' Drop means i didn't get a match.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: VLOOKUP Problem has me stumped

    You are correct, IFERROR() is not available until 2007. Try this instead...
    =IF(ISERROR(VLOOKUP($A9,CA_RR1_FINAL!$W$3:CA_RR1_FINAL!$X$46,2,0)),"",VLOOKUP($A9,CA_RR1_FINAL!$W$3:CA_RR1_FINAL!$X$46,2,0))
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: VLOOKUP Problem has me stumped

    I didn't download your file.

    What type of data does the formula normally return? Text? Numbers? Could be either? Something else?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: VLOOKUP Problem has me stumped

    No need in repeating the sheet name for a 2d range reference.

    =IF(ISERROR(VLOOKUP($A9,CA_RR1_FINAL!$W$3:$X$46,2,0)),"",VLOOKUP($A9,CA_RR1_FINAL!$W$3:$X$46,2,0))

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: VLOOKUP Problem has me stumped

    Quote Originally Posted by Tony Valko View Post
    What type of data does the formula normally return?
    If the formula normally returns TEXT this will return a blank instead of the error:

    =LOOKUP("zzzzz",CHOOSE({1,2},"",VLOOKUP($A9,CA_RR1_FINAL!$W$3:$X$46,2,0)))

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: VLOOKUP Problem has me stumped

    Quote Originally Posted by Tony Valko View Post
    No need in repeating the sheet name for a 2d range reference.

    =IF(ISERROR(VLOOKUP($A9,CA_RR1_FINAL!$W$3:$X$46,2,0)),"",VLOOKUP($A9,CA_RR1_FINAL!$W$3:$X$46,2,0))
    Good catch Tony, I didnt even look at that

  9. #9
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: VLOOKUP Problem has me stumped

    First column in the range for vlookup contains numbers and the second column contains alpha numeric

  10. #10
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: VLOOKUP Problem has me stumped

    Tony,

    This formula worked perfectly - thanks so much!!

    I will mark this thread closed

  11. #11
    Forum Contributor
    Join Date
    07-20-2015
    Location
    Jacksonville, Florida
    MS-Off Ver
    Excel 2016
    Posts
    313

    Re: VLOOKUP Problem has me stumped

    Hi Tony and Ford,

    Thanks for your help on this and also for the comment about repeating the sheet name for a 2nd range reference - I've been doing that for all my vlookups and didn't know you didn't need to put it for the 2nd range. That will same me a lot of typing in the future..

    I will close this thread now.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: VLOOKUP Problem has me stumped

    You're welcome. Thanks for the feedback!

+ 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. [SOLVED] Vlookup stumped!!
    By TonyforVBA in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-11-2014, 08:07 AM
  2. Replies: 4
    Last Post: 11-28-2013, 09:21 PM
  3. Replies: 6
    Last Post: 05-28-2013, 05:08 PM
  4. A problem that would be best solved with VBA...but I am stumped as to how :-/
    By NYCKatieP in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2013, 11:25 AM
  5. [SOLVED] VLOOKUP / ISNUMBER / SUMIF Stumped, can't get formula to run
    By abbyalana in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-29-2012, 04:47 PM
  6. Replies: 8
    Last Post: 11-23-2012, 10:58 AM
  7. Stumped on a formula (combo of sumif, vlookup, subtraction?)
    By silentheidi in forum Excel General
    Replies: 1
    Last Post: 05-11-2012, 07:26 PM
  8. I am stumped on a linking problem...
    By FishHead in forum Excel General
    Replies: 3
    Last Post: 04-27-2006, 12:20 PM

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