> For the complete documentation index, see [llms.txt](https://docs.fabricplan.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fabricplan.com/documentation/plan/planning-sheets/formula-syntax/conditional-statements.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
