HomeFree lessonsPremiumAbout
← All free Excel lessons

IF in Excel

Return one value when a test is true and another when false. Learn the concept, work through a practical example, and check your answer.

What does IF do?

IF contains a logical test, the value when true, and the value when false. It is a foundation for spreadsheet decision rules.

Workplace example

Target is in B2 and actual sales are in C2. Show Met when actual meets or exceeds target, otherwise Below.

Example solution

=IF(C2>=B2,"Met","Below")

Try the practice question before looking at the solution again. In Excel, formula arguments are separated by commas in many regional settings; your Excel installation may use semicolons.

Practice exercise

Target is in B2 and actual sales are in C2. Show Met when actual meets or exceeds target, otherwise Below.

Take it further

Try replacing the words with numeric flags 1 and 0.

Common mistake: Check that your ranges cover the correct rows and that text criteria are enclosed in quotation marks when required. When copying formulas, pay attention to relative versus absolute references.

Explore another free exercise →