← Level 2 – Formula kid

9 / 12 ⏱ 18 minutes

When a formula shows an error

What those strange messages with a hash sign mean, and how to fix them.

An error is a hint

When a formula can’t calculate, it shows an error. It starts with a hash sign #. It’s not a punishment, it’s a hint about what’s wrong.

ErrorWhat it means
#DIV/0!You’re dividing by zero or by an empty cell.
#VALUE!You’re calculating with text instead of a number.
#NAME?There’s a typo in the function name.
#REF!The formula points to a cell or sheet that doesn’t exist anymore.

When you move the mouse over a cell with an error, Google Sheets shows you an explanation.

Make an error yourself

  1. On the Ghi chús sheet, type 10 in K1 and 0 in L1.

  2. In M1, type =K1/L1. You’ll see #DIV/0!. You can’t divide by zero.

  3. Change L1 to 2. M1 shows 5. The error is gone.

  4. Type ten in K1. M1 shows #VALUE!. There’s text in it. Put the 10 back.

Fix the cause

When you see an error, fix the data, not the formula:

IFERROR

Sometimes you want something nicer to show instead of an error. That’s what the IFERROR function is for:

=IFERROR(K1/L1,"-")

If the division doesn’t work, a dash shows up.

⚠️

IFERROR only hides the error. It doesn’t fix it. Fix the data first. Only use IFERROR where an error doesn’t matter.

💡

In English settings, the parts of a formula are separated with a comma ,. In some countries’ settings, it’s a semicolon ;. If a formula with a comma doesn’t work, try a semicolon.

Average spending

On the Money sheet, type Average spending in A13 and =AVERAGE(C2:C8) in B13. You’ll see about 10.71. The zero on Saturday counts too, because the average is over all seven days.

Đến lượt bạn 💪

  1. You saw #DIV/0! and fixed it.
  2. You know what #VALUE! means.
  3. There are no errors in the whole workbook.
✅

Done when: you know what the errors mean and you can fix them.

What to take away from this lesson