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

3. Formulas and Functions

3.13 IF, Nested IF and IFS

IF and nested IF with example — in 30 seconds

What: IF checks a condition and returns one value if TRUE and another if FALSE. A nested IF puts one IF inside another for three or more bands.

Why: Order bands decide the delivery fee, the offer and the report group. One formula tags every row the same way.

Tiny example: ₹1,299 is Premium, ₹270 is Regular, ₹195 is Small (it is below 200).

First look at the data (before → after):

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

Expected result — Band in column J

A: Order ID G: Amount J: Band
BLK-1001 64 Small
BLK-1002 270 Regular
BLK-1007 1299 Premium
AMN-1008 195 Small

About this data: Teaching sample for a fictional shop “NovaCraft Tools”. Figures and names (e.g. Neha Shah) are made up for this lesson on if nested if and ifs.

Before table and formula as text

Before — Amounts to tag

A: Order ID G: Amount
BLK-1001 64
BLK-1002 270
BLK-1007 1299
AMN-1008 195

About this data: Demo table only — not real customer or company data. Built to practise if nested if and ifs.

Formula / click path

J2: =IF(G2>=1000,"Premium",IF(G2>=200,"Regular","Small"))

Do it step by step:

  1. Click J2.
  2. Type =IF(G2>=1000,"Premium",IF(G2>=200,"Regular","Small")).
  3. Check the biggest band first (1000), then the next (200). Order matters.
  4. Press Enter and copy down.
  5. Test the edge: an amount of exactly 200 must say Regular.

=IF(logical_test, value_if_true, [value_if_false])

Goal Formula Row 11 result
Late or on time =IF(H2>15,"Late","On time") Late (17 mins)
Delivery fee: free above ₹199 =IF(G2>=199,0,25) 25

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

Nested IF (एकात एक गुंफलेले IF) – an IF inside another IF – for more than two outcomes:

=IF(G2>=1000,"Premium",IF(G2>=200,"Regular","Small"))

IFS (Excel 2019+) is easier to read: tests are checked in order and the first TRUE wins.

=IFS(G2>=1000,"Premium", G2>=200,"Regular", TRUE,"Small")
Amount Result
1,299 Premium
270 Regular
90 Small

About this data: Fictional worksheet used in class. Safe to edit; nothing here is live production data.

Ravindra Bagale's Tip

In a nested IF, if the order of conditions is wrong, the result is wrong – many students write G2>=200 first, and then even ₹1,299 gets "Regular". Keep one direction, from the biggest value to the smallest (or the other way round). In IFS, add TRUE at the end; otherwise, when nothing matches, you get #N/A. If you have more than 4–5 levels, use a lookup table (Module 4).

Practice task

Bonus for store managers: 10% of sales if sales > ₹1,00,000, else 5% (this style of question is reported in interviews – see Module 18). Grade delivery time: ≤ 10 Excellent, ≤ 15 Good, else Needs Improvement.

Loading practice tasks...

  1. Regular or Small (Easy): If G3 is 200 or more show "Regular", else "Small".
  2. Late or On time (Easy): If H8 is more than 15 show "Late", else "On time".
  3. Loan: approve or review (Easy): If Loans!B2 is 750 or more show "Approve", else "Review".
  4. Delivery fee (Medium): If G2 is 500 or more the fee is 0, else 30.
  5. Three bands with nested IF (Medium): For G8: 1000 or more = "Premium", 200 or more = "Regular", else "Small".
  6. Loan: income check (Medium): If Loans!C3 is 50000 or more show "Eligible", else "Not eligible".
  7. Loan: risk with nested IF (Medium): For Loans!B4: 750 or more = "Low risk", 650 or more = "Medium risk", else "High risk".
  8. Three bands with IFS (Hard): Same bands for G9 using IFS.
  9. Status message (Hard): If I5 is "Cancelled" show "Refund", else "OK".
  10. Loan: risk with IFS (Hard): Same risk bands for Loans!B5 using IFS.

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 If Nested If And Ifs?
Card 1: What is If Nested If And Ifs? · Download PNG
Revision card 2: Tiny example — If Nested If And Ifs
Card 2: Tiny example — If Nested If And Ifs · Download PNG
Revision card 3: Checklist — If Nested If And Ifs
Card 3: Checklist — If Nested If And Ifs · Download PNG