Syntax
=IFS(logical_test1, value_if_true1, ...)Arguments
| Argument | Required | Description |
|---|---|---|
logical_test1 | Required | The first condition |
value_if_true1 | Required | The result when it is TRUE |
How to use IFS
IFS takes 2 required arguments, and accepts more values in the same pattern. Type =IFS( in a cell and SheetsBat shows the arguments as you go. Optional arguments are shown in square brackets; leave them out to use their default.
Examples
Each result below was calculated by the SheetsBat formula engine.
=IFS(1>2, "a", 2>1, "b")Result =IFS(FALSE, 1)Result Related logical functions
- FALSEThe logical value FALSE.
- IFReturns one value when a condition is TRUE and another when it is FALSE.
- IFERRORReturns a value of your choice when a formula gives an error, otherwise the formula result.
- IFNAReturns a value of your choice when a formula gives #N/A, otherwise the formula result.
- LAMBDACreates a reusable function with parameters. Call it right away, store it in a name or pass it to MAP, REDUCE and friends.
- LETNames the results of calculations so a formula can reuse them.
- NOTReverses a logical value.
- ORTRUE when any argument is TRUE.
- SWITCHCompares a value with a list of cases and returns the result of the first match, or a default.