> 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/sumif.md).

# SUMIF

The **SUMIF** function returns the sum of values in a list that satisfy a specified condition.

### Syntax <a href="#syntax" id="syntax"></a>

<pre class="language-javascript"><code class="lang-javascript"><strong>SUMIF(list, condition, [range])
</strong></code></pre>

### Arguments

* *list*: The list of values to evaluate.
* *condition*: The condition used to filter values in the list.
* *range* (Optional): The list of values to sum if the values in the *list* meet the condition. If not specified, the values in the original *list* are summed.

### Return value

Returns the sum of values that satisfy the condition.

### Example <a href="#example" id="example"></a>

#### 1. Without Range <a href="#example" id="example"></a>

<pre class="language-javascript"><code class="lang-javascript"><strong>SUMIF([10, 20, 30, 40], ">20")
</strong></code></pre>

In this example, the **SUMIF** function returns the sum of values greater than 20 from the list and returns 70 (30 + 40).

#### 2. With Range <a href="#example" id="example"></a>

<pre class="language-javascript"><code class="lang-javascript"><strong>SUMIF([10, 20, 30, 40], ">20", [1, 2, 3, 4])
</strong></code></pre>

The **SUMIF** function evaluates the values in the first list and returns the sum of corresponding values from the second list where the condition is met. In this example, the result is 7 (3 + 4).


---

# 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/sumif.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.
