IF

Returns one value if a logical expression is `TRUE` and another if it is `FALSE`. Learn more

Video field
Logical

In Google Sheets, the IF function is a logical function that checks whether a given logical expression is true or false, and returns one value if it's true and another value if it's false.

The syntax for the IF function is:

IF(logicalexpression, valueiftrue, valueif_false)

logical_expression: This is the condition that you want to test. It can be a comparison of two values using operators like <, >, =, <=, >=, or it can be a logical expression like AND, OR, or NOT.

valueiftrue: This is the value that is returned if the logical_expression is true.

valueiffalse: This is the value that is returned if the logical_expression is false.

For example, suppose you have a cell A1 that contains a number, and you want to check whether it's greater than 10. If it is, you want to display the text "Greater than 10", otherwise you want to display the text "Less than or equal to 10". You can use the IF function to achieve this as follows:

=IF(A1>10, "Greater than 10", "Less than or equal to 10")

Want even more from Google Sheets?


With Softr, you can turn your spreadsheets into powerful web apps.You can give advanced roles and permissions to each user, build advanced logic and automation flows, customize the design to your needs, and much more.


Softr also offers a growing library of templates for internal tools, client portals, community hubs, and more. The templates come with a Google Sheet or an Airtable base that you can use to store and manage your data easily.


Try Softr now and build your custom web apps in 10 minutes no code required!