Learn how to use Excel logic functions such as IF (IF), И (AND) и OR (GOLD).
IF function
Function IF (IF) checks if the condition is true and returns the value TRUE (TRUE) if it is, or LYING (FALSE) if not satisfied.
- Highlight a cell C1 and enter the following formula:
=ЕСЛИ(A1>10;"Correct";"Incorrect")
=IF(A1>10,"Correct","Incorrect")
- Function IF (IF) returns “Correct” because the value in the cell A1 more than 10.
Function And
Function И (AND) returns a value TRUE (TRUE) if all conditions are met, and LYING (FALSE) if at least one of the conditions is false.
- Highlight a cell D1 and enter the following formula:
=ЕСЛИ(И(A1>10;B1>5);"Correct";"Incorrect")
=IF(AND(A1>10,B1>5),"Correct","Incorrect")
- Function И (AND) returns LYING (FALSE) because the value in the cell B1 less than 5. As a result, the function IF (IF) returns “Incorrect”.
OR function
Function OR (OR) returns a value TRUE (TRUE) if at least one condition is met, and LYING (FALSE) if all conditions are false.
- Highlight a cell E1 and enter the following formula:
=ЕСЛИ(ИЛИ(A1>10;B1>5);"Correct";"Incorrect")
=IF(OR(A1>10,B1>5),"Correct","Incorrect")
- Function OR (OR) returns TRUE (TRUE) because the value in the cell A1 greater than 10. As a result, the function IF (IF) returns “Correct”.
Note: functions И (AND) и OR (OR) are able to check up to 255 conditions.