Cellgrids Cellgrids
Home › Excel formulas › Logic › IF

IF Function in Excel: Syntax, Examples and Free Practice

By Rinkesh Shah, founder of Cellgrids.

IF is an Excel Logic function. Returns one value if a condition is true, another if false.

IF syntax

=IF(logical_test, value_if_true, value_if_false)

Arguments

When to use IF

Flagging an employee as Pass or Fail based on a score cutoff.

Practice IF online, free

Solve graded IF practice questions in a live Excel-style spreadsheet and check your answer instantly.

Practice IF now →

Watch: IF in Excel

Watch on YouTube

Learn more

Read the tutorial: IF with AND / OR.

IF practice questions

More Logic functions

Frequently asked questions

What does the IF function do in Excel?

Returns one value if a condition is true, another if false.

What is the syntax of IF in Excel?

The syntax is =IF(logical_test, value_if_true, value_if_false). logical_test: The condition to check, e.g. B2>=40; value_if_true: Result if true; value_if_false: Result if false.

Where can I practice IF online for free?

Open the free live spreadsheet on Cellgrids and try IF yourself. No Excel install is needed and you can start without signing up.

All Excel formulas · Cheat sheet · Excel exercises · Logic functions · Excel case studies · Excel tutorials · Excel shortcuts