#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
Module 2
6 min

IF Statements

Make Excel think and decide for you

IF Statements

The IF function lets Excel make decisions for you.

Think about it like this:

In daily life: "If it is raining, take umbrella. If not, do not take umbrella."

In Excel: "If the score is above 60, show Pass. If not, show Fail."

The IF Formula

=IF(condition, yes_result, no_result)

IF Formula Structure

It has 3 parts:

PartWhat It MeansExample
conditionThe question you are askingA1>60
yes_resultWhat to show if answer is YESPass
no_resultWhat to show if answer is NOFail
3 rows

Your First IF Formula

Problem: Check if a student passed (score above 60).

Cell A1 has the score: 75

Formula: =IF(A1>60, "Pass", "Fail")

What Excel does:

  1. Is 75 greater than 60? YES
  2. So show: Pass

Pass Fail Example

Practice: Pass or Fail

Easy

If score in A1 is greater than 60, show "Pass". Otherwise show "Fail".

A
B
C
D
E
F
1
2
3
4
5
6

Another Example

Problem: Check if we need to order more items (quantity below 10).

Cell A1 has quantity: 5

Formula: =IF(A1<10, "Order More", "OK")

What Excel does:

  1. Is 5 less than 10? YES
  2. So show: Order More

Practice: Check Stock

Easy

If quantity in A1 is less than 10, show "Order More". Otherwise show "OK".

A
B
C
D
E
F
1
2
3
4
5
6

Comparison Symbols

SymbolMeaningExample
>Greater thanA1>60
<Less thanA1<10
=Equal toA1=100
>=Greater than or equalA1>=60
<=Less than or equalA1<=50
<>Not equal toA1<>0
6 rows

Checking Text

You can also check text values. Put the text in quotes.

Example: Check if payment status is "Paid".

=IF(A1="Paid", "Done", "Pending")

If A1 contains "Paid", it shows "Done". Otherwise, it shows "Pending".

Practice: Check Payment

Easy

If A1 equals "Paid", show "Done". Otherwise show "Pending".

A
B
C
D
E
F
1
2
3
4
5
6

Doing Math in IF

You can do calculations in the result.

Example: Give 10% discount if purchase is over 100.

=IF(A1>100, A1*0.9, A1)

If A1 is 150:

  1. Is 150 greater than 100? YES
  2. So calculate: 150 * 0.9 = 135

Practice: Calculate Discount

Easy

If A1 is greater than 100, multiply A1 by 0.9 (10% off). Otherwise just show A1.

A
B
C
D
E
F
1
2
3
4
5
6

Multiple Conditions (Nested IF)

Sometimes you need to check more than two options.

Example: Assign grades based on score.

  • 90 or above = A
  • 70 or above = B
  • Below 70 = C

=IF(A1>=90, "A", IF(A1>=70, "B", "C"))

How it works:

  1. First check: Is score >= 90? If yes, show "A"
  2. If no, check: Is score >= 70? If yes, show "B"
  3. If no, show "C"

Nested IF Example

Practice: Assign Grade

Easy

If A1>=90 show "A". If A1>=70 show "B". Otherwise show "C".

A
B
C
D
E
F
1
2
3
4
5
6

Common Mistakes

Mistake 1: Forgot quotes around text

Wrong: =IF(A1>60, Pass, Fail)

Right: =IF(A1>60, "Pass", "Fail")

Mistake 2: Forgot comma between parts

Wrong: =IF(A1>60 "Pass" "Fail")

Right: =IF(A1>60, "Pass", "Fail")

Summary

  • IF lets Excel make decisions
  • Formula: =IF(condition, yes_result, no_result)
  • Always put text in quotes: "Pass"
  • Use symbols: >, <, =, >=, <=, <>
  • You can nest IF inside IF for multiple conditions

IF is one of the most useful functions in Excel. Practice it until it becomes natural.

SkillsetMaster - AI, Web Development & Data Analytics Courses