# SUMIF

The SUMIF function adds the values in a list that meet a specified condition. It evaluates the given range against the defined criteria and includes only those values that satisfy the condition in the total. This function is commonly used in reporting to calculate conditional totals, such as sums above a threshold or values that match specific rules.

### Syntax

```javascript
SUMIF([list],condition,[range])
```

### Arguments

list – An array of numbers to iterate through (Required).

condition – The numbers are summed up if they meet the condition specified in this argument (Required).

range - An array of numbers that will be summed if the numbers in the list array meet the condition. If a range argument is not given, the array or numbers in the list argument are summed up (Optional).

### Example

```javascript
SUMIF([COLUMN1,COLUMN2],"CONDITION")
```

**Example 1:**

In this example, we have not passed the 3rd range parameter. If the sum of the highlighted cells exceeds 20m, then the same cells are summed up.

<figure><img src="/files/eDY9jlWCyaCcqeuLo6Ft" alt=""><figcaption><p>SUMIF without a range parameter</p></figcaption></figure>

**Example 2:**

This is another way to use SUMIF without passing the range parameter. If the sum of the actuals and plan exceeds 20m, then the actuals and plan are summed up for each row. When the condition is not met, SUMIF yields 0.

<figure><img src="/files/YVEnoO6mcpEGiYqcNjAt" alt=""><figcaption><p>SUMIF for each row without a range parameter </p></figcaption></figure>


---

# 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.inforiver.com/formula-syntax/math-functions/sumif.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.
