Table of contents
×
Formulas & functions
Formulas & functions

IF

Your browser does not support video.

Try it!

Use IF to return a value based on a condition.

For example, =IF(C2=”Yes”,1,2) says IF(C2 = Yes, then return a 1, otherwise return a 2).

IF

  1. Select a cell.

  2. Type =IF and a left parenthesis (.

  3. Add the condition you want to test, and type a comma.

  4. Add the value to return if the condition is true, and type a comma.

  5. Add the value to return if the condition is false, and type a right parenthesis ).

  6. Press Enter.

  7. If needed, drag the handle to apply the IF function to other rows.

Want more?

IF function

Need more help?

Expand your skills
Explore Training
Get new features first
Join Microsoft Insiders

Was this information helpful?

What affected your experience?

Thank you for your feedback!

×