# Conditional statements

Conditional statements let you perform calculations based on specified conditions. These functions evaluate expressions and return different values depending on whether the conditions are true or false. They are commonly used to apply business logic, categorize data, filter results, and handle exceptions.

In Plan, conditional statements help you create dynamic calculations that adapt to different scenarios, such as applying thresholds, categorizing data, or managing error conditions.

### In this category

<table><thead><tr><th width="168">Function</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td><a href="/pages/6ncprsZrxfdDkhQqJjzD">IF</a></td><td>Returns one value if a condition is true and another value if it is false.</td><td></td></tr><tr><td><a href="/pages/kpV70s7pDTMSFZYVw42Y">IFNA</a></td><td>Returns the specified value if an expression results in the #N/A error.</td><td></td></tr><tr><td><a href="/pages/OmwDdnAK2dkOY0S3FhYJ">AVERAGEIF</a></td><td>Returns the average of values in a list that meet the given condition.</td><td></td></tr><tr><td><a href="/pages/iECGUFe2ReeJVSry1GSt">COUNTIF</a></td><td>Returns the count of values that meet a specified condition.</td><td></td></tr><tr><td><a href="/pages/XIeCjaoVGMXYSBB69OuQ">SUMIF</a></td><td>Returns the sum of values that meet a specified condition.</td><td></td></tr><tr><td><a href="/pages/I7lPfAjhtweIMLU9AgMU">FILTERIF</a></td><td>Returns a filtered list of values based on a specified condition.</td><td></td></tr><tr><td><a href="/pages/lpQusNFc5ikkcgPkPBGv">SWITCH</a></td><td>Evaluates an expression against a list of values and returns the result corresponding to the first matching value. If no match is found, an optional default value is returned.</td><td></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.fabricplan.com/planning-sheets/formula-syntax/conditional-statements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
