VLOOKUP query

hatstand

Well-known Member
Joined
Mar 17, 2005
Messages
778
Office Version
  1. 2016
Platform
  1. Windows
I have a VLOOKUP formula that when a recognised entry is made. A cell is populated with the answer. My problem is that some entries are made that are not in the table so the answer is, what ever the closest match is. Can the formula include something that gives the answer “not on list” when a non-table entry is made.
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
For an exact match you need to set VLOOKUP's fourth (Range_lookup) to FALSE. You can use ISNA to check and return some text, eg:

=IF(ISNA(VLOOKUP(Ref,Table,2,FALSE)),"not on list",VLOOKUP(Ref,Table,2,FALSE))
 
Upvote 0
Make sure that you have the last argument in the VLOOKUP function set to FALSE or 0 so that it does not return approximate matches. It will then return "#N/A" for all non-matches.

If you want to return something else, use this format:
=IF(ISNA(VLOOKUP(...)),"not on list","VLOOKUP(...))
 
Upvote 0
A big thank you

A big thanks to everyone, never had so many answers so quick. It's working perfectly.
 
Upvote 0

Forum statistics

Threads
1,214,943
Messages
6,122,380
Members
449,080
Latest member
Armadillos

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top