Ravindra BagaleCourses & study guides मराठी Track your progress

3. Formulas and Functions

3.15 IFERROR and IFNA

IFERROR with example — in 30 seconds

What: IFERROR shows your own message when a formula returns an error.

Why: One #DIV/0! breaks the SUM below it and looks bad in a report. A clear message tells people what to fix.

Tiny example: Amount ₹90 with Qty 0 gives #DIV/0!. =IFERROR(G2/F2,"Check Qty") shows "Check Qty" instead.

First look at the data (before → after):

IFERROR with example: before and after tables, fictional FreshGo Maharashtra data

Expected result — With IFERROR

A: Order ID J: Unit price
BLK-1001 32
BLK-1010 Check Qty
BLK-1002 90

About this data: Teaching sample for a fictional shop “Maple Bakery Co”. Figures and names (e.g. Vikram Rao) are made up for this lesson on iferror and ifna.

Before table and formula as text

Before — Unit price = G/F (one Qty typed as 0)

A: Order ID G: Amount F: Qty =G2/F2
BLK-1001 64 2 32
BLK-1010 90 0 #DIV/0!
BLK-1002 270 3 90

About this data: Demo table only — not real customer or company data. Built to practise iferror and ifna.

Formula / click path

J2: =IFERROR(G2/F2,"Check Qty")

Do it step by step:

  1. Click J2 and type =IFERROR(G2/F2,"Check Qty").
  2. Press Enter and copy down.
  3. Filter column J for "Check Qty" to find the bad rows.
  4. Fix the Qty in the source data. The message disappears by itself.
  5. Use IFNA instead when you only want to catch #N/A from lookups.
Function Catches Example
IFERROR(value, value_if_error) every error type =IFERROR(G2/F2,0)
IFNA(value, value_if_na) (Excel 2013+) only #N/A =IFNA(XLOOKUP(…),"Not found")

About this data: Made-up rows so you can copy the pattern for iferror and ifna. Currencies may use ₹, £, € or $.

Worked example. Amount per unit when Qty may be blank: =IFERROR(G2/F2,"Check Qty"). Store lookup: =IFNA(VLOOKUP(A2,Stores!A:F,4,FALSE),"New store – add to master").

Ravindra Bagale's Tip

IFERROR hides every error – even a #NAME? caused by a typo or a #REF! caused by a deleted column! Many students wrap every formula in IFERROR and hide the real mistake. Use IFNA for lookups, and use IFERROR only where an error is expected.

Practice task

Calculate Amount/Qty with IFERROR. Look up a store's city with IFNA and show "Missing in master" for unknown store IDs.

Loading practice tasks...

  1. Unit price (Easy): Find the price of one item for row 2 (B2/C2).
  2. Shop: price per pack (Easy): Find Retail!B2/Retail!C2.
  3. Hide the error (Medium): For row 3, show "Check Qty" if B3/C3 gives an error.
  4. No error case (Medium): Use the same IFERROR formula for row 4.
  5. Zero instead of error (Medium): For row 3, show 0 if B3/C3 gives an error.
  6. Shop: no sale message (Medium): For row 3, show "No sale" if Retail!B3/Retail!C3 is an error.
  7. Shop: zero instead (Medium): For row 3, show 0 if Retail!B3/Retail!C3 is an error.
  8. Shop: normal row (Medium): Divide Retail B4 by Retail C4. If it gives an error, show "No sale".
  9. Not found message (Hard): Look up "BLK-1099" in A2:C4 (column 2). Show "Not found" if it is missing.
  10. Shop: item not stocked (Hard): Look up "Ghee" in Retail!A2:C5 (column 2). Show "Not stocked" if missing.

Quick revision cards

Three standalone cards. Each one explains the idea with its own example. Scan the QR to open this lesson.

Revision card 1: What is Iferror And Ifna?
Card 1: What is Iferror And Ifna? · Download PNG
Revision card 2: Tiny example — Iferror And Ifna
Card 2: Tiny example — Iferror And Ifna · Download PNG
Revision card 3: Checklist — Iferror And Ifna
Card 3: Checklist — Iferror And Ifna · Download PNG