How to use 'If Error' with a V-Lookup
![How to use 'If Error' with a V-Lookup](https://365traininghub.strapi.nz/uploads/Excel_if_error_e88b25086b.png)
When working with Excel, you might encounter situations where your VLOOKUP function returns errors, such as #N/A
, if it can’t find the lookup value. To handle these errors gracefully, you can use the IFERROR
function to display a custom message or perform an alternative calculation. Here’s a step-by-step guide to creating a nested formula using IFERROR
with VLOOKUP
.
Step 1: Understand the Basics of VLOOKUP
Before we dive into the nested formula, let’s quickly review the VLOOKUP
function. The syntax for VLOOKUP
is:
VLOOKUP(lookup_value, table_array, col_index_num, [range_lookup])
lookup_value
: The value you want to search for.table_array
: The range of cells that contains the data.col_index_num
: The column number in the table from which to retrieve the value.[range_lookup]
: Optional;TRUE
for an approximate match orFALSE
for an exact match.
Step 2: Understand the Basics of IFERROR
The IFERROR
function helps you manage errors in your formulas. The syntax for IFERROR
is:
IFERROR(value, value_if_error)
value
: The formula or expression to check for errors.value_if_error
: The value to return if an error is found.
Step 3: Combine IFERROR with VLOOKUP
To create a nested formula that uses IFERROR
with VLOOKUP
, follow these steps:
Start with the VLOOKUP Formula: Begin by writing your
VLOOKUP
formula. For example:=VLOOKUP(A2, B2:D10, 3, FALSE)
Wrap the VLOOKUP Formula with IFERROR: Next, wrap the
VLOOKUP
formula withIFERROR
to handle any errors. For example:=IFERROR(VLOOKUP(A2, B2:D10, 3, FALSE), "Not Found")
In this example, if the
VLOOKUP
function returns an error, the formula will display “Not Found” instead.
Step 4: Enter the Formula in Excel
Click on the cell where you want to enter the formula.
Type the nested formula:
=IFERROR(VLOOKUP(A2, B2:D10, 3, FALSE), "Not Found")
Press Enter to apply the formula.
Step 5: Copy the Formula to Other Cells
If you need to apply the same formula to other cells, you can copy it. Click on the cell with the formula, then drag the fill handle (a small square at the bottom-right corner of the cell) down or across to copy the formula to adjacent cells.
Conclusion
Using IFERROR
with VLOOKUP
is a powerful way to handle errors in your Excel formulas. By following these steps, you can create a nested formula that ensures your data is displayed cleanly and accurately, even when lookup values are missing. This technique helps maintain the integrity of your spreadsheets and makes them more user-friendly.
Keen to stay up to date on anything 365?
Sign up for tips and updates
You may also like
![How to find emails in Outlook by Date](https://365traininghub.strapi.nz/uploads/Outlook_search_by_date_65333edb42.png)
![Find out about the Calculator App in Windows 10](https://365traininghub.strapi.nz/uploads/calculator_app_30cbacb33d.png)
![Introducing Chat GPT - What, Why and Where!](https://365traininghub.strapi.nz/uploads/CHAT_GPT_8fc7eba14d.png)