IF Function in Excel

IF returns one value if a condition is true and another if false.

1 min read · Updated 17 Oct 2026 · By Md. Saiful Islam · বাংলায় পড়ুন

What is the IF Function

The IF function checks a condition and returns one value if the condition is true and another if it is false. It is the most important function for decision-making in Excel and the foundation of most business logic.

Formula: =IF(logical_test, value_if_true, value_if_false)

Practical Example 1

Student marks are in B2. Pass mark is 40.

Type: =IF(B2>=40, Pass, Fail)

Result: Pass or Fail

Practical Example 2

Give a discount if the purchase amount is above 1000.

Type: =IF(B2>1000, 10 percent, 0 percent)

Result: the discount rate

Practical Example 3

Nest IF to check multiple conditions.

Type: =IF(B2>=80, A, IF(B2>=60, B, IF(B2>=40, C, Fail)))

Result: the grade letter

Practical Example 4

Combine IF with AND for multi-condition checks.

Type: =IF(AND(B2>=40, C2>=75), Pass, Fail)

Result: Pass only if both conditions are met

When to Use It

IF is used for grading students, for setting targets and flags, for eligibility checks, for budget approval routing, for assigning categories, and for any decision logic in Excel.

Get one practical IE tip every week

Join IE and production professionals learning with in2eff.