IF Function general syntax
Answers
Answer:
IF function
In this course:
Overview of formulas in Excel
Article
VLOOKUP
Article
SUM function
Article
COUNTIF function
Article
IF function
Article
IFS
Article
SUMIF
Article
SUMIFS
Article
Automatically number rows
Article
Calculate the difference between two dates
Article
Define and use names in formulas
Article
Combine text from two or more cells into one cell
Article
Next: Tables
The IF function is one of the most popular functions in Excel, and it allows you to make logical comparisons between a value and what you expect.
So an IF statement can have two results. The first result is if your comparison is True, the second if your comparison is False.
For example, =IF(C2=”Yes”,1,2) says IF(C2 = Yes, then return a 1, otherwise return a 2).
Syntax
Simple IF examples
Cell D2 contains a formula =IF(C2="Yes",1,2)
=IF(C2=”Yes”,1,2)
In the above example, cell D2 says: IF(C2 = Yes, then return a 1, otherwise return a 2)
Cell D2 contains the formula =IF(C2=1,"YES","NO")
=IF(C2=1,”Yes”,”No”)
In this example, the formula in cell D2 says: IF(C2 = 1, then return Yes, otherwise return No)As you see, the IF function can be used to evaluate both text and values. It can also be used to evaluate errors. You are not limited to only checking if one thing is equal to another and returning a single result, you can also use mathematical operators and perform additional calculations depending on your criteria. You can also nest multiple IF functions together in order to perform multiple comparisons.