Handle VLOOKUP N/A errors with IFNA in Google Sheets
In Google Sheets, combine IFNA with VLOOKUP to replace N/A results by an empty or user-friendly value.
In this example, we'll try to find a company name based on a domain name and get a Not found message:
Formula in G4
=IFNA(VLOOKUP(G3,B4:D6,3,FALSE),"Not found")
A
B
C
D
E
F
G
H
1
2
Column 1
Column 2
Column 3
👇 Try changing this value
3
Domain
Size
Company name
Lookup value
4
google.com
139995
Google
Result
Not found
5
talarian.io
50
Talarian
6
microsoft.com
182268
Microsoft
7
Show arrows
Separator
Procedure
- Build the VLOOKUP formula:
- Enter =VLOOKUP in cell G4, where you want the Company name to appear.
- Enter the Lookup value G3, which contains the Domain name (domain.com) you want to look for.
- Enter the Search range B4:D6, which is the data range containing the Domain, and the Company name values.
- Enter Column number 3, as the Company name column is the 3rd column of the Search range.
- Enter FALSE to look for an exact match.
- Build the IFNA formula around the VLOOKUP formula:
- Enter IFNA( between the = and VLOOKUP formula.
The formula looks like this:=IFNA(VLOOKUP(G4, B4:D6, 3, FALSE)
- Enter "Not found" right after the VLOOKUP formula.
The formula looks like this:=IF(VLOOKUP(F4, B4:D6, 3, FALSE), "Not found")
- Enter IFNA( between the = and VLOOKUP formula.
Result
The final formula is: =IFNA(VLOOKUP(G3, B4:D6, 3, FALSE), "Not found")
IFNA returns the value in G4, which is Not found.