• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 4242
  • Last Modified:

Vlookup formula that excludes certain values from the range


I need to use a simple vlookup formula such as:
 =IFERROR(VLOOKUP($B66,'A Pivot'!$A$5:$G$5087,2,FALSE),"") ...the only addition that I need to have is to exclude the following values from the range:
1691; 5201; 5214 & 5206....(my list of these values is longer but I hope to the my point to you)

How should my formula be modified?

  • 2
1 Solution
barry houdiniCommented:
I'm not sure I understand what you mean by "Exclude the following values from the range". Do you mean those values shouldn't be results of the VLOOKUP? What should happen instead?

regards, barry
LadkissonAuthor Commented:
the column I am referencing in my range should exclude the values I mentioned above...instead it should give me something like "not needed"
barry houdiniCommented:
OK, I assume you mean that if B66 is one of those values then show "not needed". Try listing the exclusion values on the worksheet, e.g. in Z2:Z10 and then using this version

=IFERROR(IF(COUNTIF($Z$2:$Z$10,$B66),"Not needed",VLOOKUP($B66,'A Pivot'!$A$5:$G$5087,2,FALSE)),"")

regards, barry
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now