IF formula and example in Excel and Google Sheets

Formula, examples and how to use it

=IF(logical_expression, value_if_true, value_if_false)

One of the most popular functions used in Excel and Google Sheets, and returns one value if a logical expression is 'TRUE' and another if it is 'FALSE'.