What is IF function in Excel?

The IF function is used to execute the logic test. It determines whether or not specific criteria are true. If the condition is true, the result or output will be as expected. If the condition is false, the result or output will be as expected.
For instance, suppose you choose a cell and want it to display “more than five” when the value is true (=5 or 5) and “less than five” when the value is false (<5). You may display the result by using an IF condition.

=IF (Logical test, value if true, value if false)

=IF (A1>5, "More than five, “Less than five”)