Not Reflecting Errors When Your Function Result Returns An Error

KuraiChikara

Board Regular
Joined
Nov 16, 2016
Messages
111
Office Version
  1. 2013
Platform
  1. Windows
When doing a Vlookup, I was wondering how you omit or even change the result if it comes back as an #N/A error.

Example:
Sheet1 (master data)
A1-A4 has numeric values 1, 2, 3, 4
B1-B4 has items next to the values: B1=Apple, B2=Strawberry, B3=Kiwi, B4=Pie

Shee2:
This is where I want to find the ITEM from Sheet1 because Sheet2 also has numeric values in the A column but might not contain all numeric values that are in Sheet1

A column has numeric values
B column is where the formula goes =VLOOKUP(A1,Sheet1!A:B,2,FALSE)

If Sheet2 had the numeric values listed below it would return the #N/A result in B4, because my Sheet1 master doesnt have the numeric value 5.
What I want to do, is if the formula results in an error, to show it as blank or even change it to whatever text value wanted (No, Doesnt Match, Error, etc)

1Apple
2Strawberry
3Kiwi
5#N/A
 

Excel Facts

What is =ROMAN(40) in Excel?
The Roman numeral for 40 is XL. Bill "MrExcel" Jelen's 40th book was called MrExcel XL.
Try

VBA Code:
=IFERROR(VLOOKUP(A1,Sheet1!A:B,2,FALSE),"",VLOOKUP(A1,Sheet1!A:B,2,FALSE))
 
Upvote 0
Code:
=IF(ISNA(VLOOKUP(A1,Sheet1!A:B,2,FALSE)),"No Match!",VLOOKUP(A1,Sheet1!A:B,2,FALSE))
HTH. Dave
 
Upvote 0
Depends on your version of Excel (perhaps you could update your profile so we know the version?) but try

=IFNA(VLOOKUP(A1,Sheet1!A:B,2,FALSE) ,"Whatever you want")
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

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