Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Fixing Broken Models | Data Foundations and Excel Essentials
Excel Formulas

Fixing Broken Models

Swipe to show menu

Small data issues can quickly break calculations, summaries, and dashboards. In this chapter, add error handling to make the workbook more stable and easier to debug.

IFERROR Structure

=IFERROR(value, value_if_error)

Formula used in this chapter:

=IFERROR(XLOOKUP(D2, Products!A:A, Products!D:D) * G2, 0)
  • value: formula being evaluated;
  • value_if_error: fallback value returned when an error occurs.

Common Excel Error

#VALUE!

This error usually appears when Excel tries to calculate using the wrong data type, such as text instead of numbers.

Step 1 Create a Data Error
expand arrow

Inside the Units column, replace one numeric value with text.

Example:

Four

Notice that the Revenue formula now returns:

#VALUE!
Step 2 Observe the Impact
expand arrow

Review the affected row and summary calculations. Notice that broken data can propagate errors through dependent formulas.

Step 3 Add IFERROR to the Revenue Formula
expand arrow

Update the Revenue formula in H2:

=IFERROR(XLOOKUP(D2, Products!A:A, Products!D:D) * G2, 0)
  • XLOOKUP(...) * G2: main calculation;
  • 0: fallback value if the formula fails.

Press Enter and apply the formula down the column.

Step 4 Improve Error Visibility
expand arrow

Replace the fallback value with a custom message:

=IFERROR(XLOOKUP(D2, Products!A:A, Products!D:D) * G2, "Check data")

This makes broken rows easier to identify during debugging.

Step 5 Handle Missing Products in XLOOKUP
expand arrow

Inside the dataset, test a product that does not exist in the Products table.

Example:

Airpods

Update the formula:

=XLOOKUP(D2, Products!A:A, Products!D:D, 0)

0: value returned if the product is not found.

1. What is the main purpose of IFERROR in a formula?

2. What happens when a value like "Four" is used in a numeric multiplication?

3. Why would you use if_not_found in XLOOKUP?

question mark

What is the main purpose of IFERROR in a formula?

Select the correct answer

question mark

What happens when a value like "Four" is used in a numeric multiplication?

Select the correct answer

question mark

Why would you use if_not_found in XLOOKUP?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

Section 1. Chapter 5

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Section 1. Chapter 5
some-alt