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
-
Select a cell.
-
Type =IF and a left parenthesis (.
-
Add the condition you want to test, and type a comma.
-
Add the value to return if the condition is true, and type a comma.
-
Add the value to return if the condition is false, and type a right parenthesis ).
-
Press Enter.
-
If needed, drag the handle to apply the IF function to other rows.