Office
Sign in

Video: IF

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

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

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×