• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

vlookup returns values that are in adjacent rows

j_sun

Member
Hi,
I'm using vlookup and running into an issue where, if the formula doesn't find an exact match in the lookup range, it returns the value from the adjacent row. I really want to leave it blank if there is no match. Is there a setting in the formula I'm missing or is this one of the many annoying limitations/quirks of a vlookup?
If so, any suggestions on how to accomplish what I need with another formula?

Thanks!
 
Hi j_sun
Try to use an IF and ISERROR functions it works for me

=IF(ISERROR(VLOOKUP(A2,G:H,2,FALSE)),"",(VLOOKUP(A2,G:H,2,FALSE)))

A2 = Look-up Value
G:H = Table array
2 = col_index_num

I hope it's what you're looking for
 
Hi j_sun,

I believe you have missed a important step in the vlookup function. For an exact match you want to use "FALSE" for the [range_lookup] option.

This will return N/A# if it can't find a match. If you want to leave it blank, you can nest the function inside an IFERROR function. I.g. =IFERROR(VLOOKUP($B1,$A$1:$A$10,FALSE),"")
 
Hi j_sun,

I believe you have missed a important step in the vlookup function. For an exact match you want to use "FALSE" for the [range_lookup] option.

This will return N/A# if it can't find a match. If you want to leave it blank, you can nest the function inside an IFERROR function. I.g. =IFERROR(VLOOKUP($B1,$A$1:$A$10,FALSE),"")

This was my first thought as well....
 
I am not sure I understood you queation clearly...
However, instead of ISERROR() you could also use the older way
IF(ISNA(Vlookup(...));"lookupfromadjacentrow";Vlookup(...))

As @Xiq mentionned, do not forget the FALSE argument as last argument in the Vlookup function


 
Back
Top