The IF function in Excel software allows for calculations that involve two or more cases depending on the result of a calculation. It is often not easy to use. Our goal is to facilitate its use for Excel users. The IF function can be used alone or often combined with the XOR (exclusive OR) or the AND (inclusive) and even both at the same time depending on the calculation conditions.

The function “IF ()”

If the result of a calculation requires analyzing only two exclusive conditions, the IF function is necessary. In the result display cell, “IF” is followed by a parenthesis in which the condition is stated, a first semicolon, the operation to perform if the condition is true, then a second semicolon, and the operation to perform if the condition is false. That is to say, the “otherwise.” Here are some examples of applying the IF function. Let’s take the example of a student’s grades in 5 subjects: 8 in Mathematics, 11 in Physics, 9 in Life Sciences, 13 in French, 12 in English, and 15 in Spanish. If their average is greater than or equal to 10, they are admitted; otherwise, they are rejected. The macro will be written as: IF (Average>=10; “Admitted”; “Rejected”)

Read also : Use Excel to Create a Calendar: Easy

The function “IF(OR(…)) or (AND(…)).”

The IF function is followed by OR if the conditions posed are numerous and the verification of just one of these conditions is sufficient, while IF is followed by AND if all conditions must be met.

Example 1: if the student does not have the average in math, they are still rejected.

Recommended read : Excel or Google Doc, how to choose?

IF (AND (Average>= 10; Math>=10); “Admitted”; “Rejected”)

Example 2: if the student does not have the average but has more than 12 in French, they are admitted in letters.

IF (OR (Average>= 10; French>12); “Admitted in letters”; “Rejected”)

It should be noted that Excel uses the column letter and row number as the cell name. Finally, we observe that the IF function is one of the easiest Excel formulas to use after the SUM function.

Excel: How to Use the IF Function