📌 More functions: see the Formula function reference.
1 Basics
IF and IFS are common AI Table logical functions — return different values or take different actions based on conditions.IF
IF lets you specify a condition and return different results based on whether it’s true. It’s one of the most basic logical tools in spreadsheets.Syntax
- condition: the logical expression to test.
- if_true: value to return when the condition is true.
- if_false: value to return when the condition is false.
Example
[Field 1] in the first record is 50.Example 1: is [Field 1] > 30?
IFS
IFS is an extension of IF — test multiple conditions and return the first match. Cleaner than nested IFs.Syntax
- condition1, condition2, …: a series of logical expressions to test.
- value1, value2, …: values to return when the corresponding condition is true.
- default (optional): value to return when no condition matches.
Example
[Field 1] in the first record is 75.Example 1: grade by score range
2 FAQ
- Q: Why does an IFS() formula have no syntax error but return #N/A? A: When the input doesn’t match any condition in IFS(), it returns #N/A. Add a fallback at the end. Example: IFS([Score]=100,“Full marks”, [Score] >=85,“Excellent”, [Score] >=75,“Good”, [Score] >=60,“Pass”, TRUE,“Fail”) — here TRUE,“Fail” is the fallback. Anything that misses the earlier conditions falls into “Fail”.