# IF

IF( `condition`, `then`, `else` )

Tests `condition` and returns `then` if `condition` is `true` and `else` if `condition` is `false`

### Arguments

| Argument    | Description                |
| ----------- | -------------------------- |
| `condition` | Boolean expression to test |
| `then`      | What to return if `true`   |
| `else`      | What to return if `false`  |

### Output

Outputs `then` if `condition` is `true` and `else` if `condition` is `false`

### Example

{% embed url="<https://datawrapper.dwcdn.net/mk46n/1/>" %}
