# SUMLISTIF

The SUMLISTIF function calculates the sum of values from a list that meet a specified condition. It iterates through the list, checks each item against the given condition, and sums only the values that satisfy it.

### Syntax:

```
SUMLISTIF (List that must be added, Condition that must be met)
```

### Parameters:

```
List that must be added: List you want to sum the elements
```

```
Condition that must be met:  Logical expression that will be checked to add the element to the list or not
```

### Usage examples:

Sum all rollerdoor widths that are bigger than 3m:

SUMLISTIF (shedresult.rollerdoors\*.width, shedresult.rollerdoors.width > 3000)

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdKqxndJT8Ft39Ewf9RPfD6u-IkoB90KEhMm_BZvqHKwq7Br8r0Av1SvCueYrefiZPhccd6uyRRQvAjeaENn_nhbyvAwYEp31l6wFBFOH0S6Wd3kUEj-RzOP8vjKr_lnpYFI8v-zB7oURUM8O7Nu5yprfc?key=XOC2SPeEfDJHl8uZwAWUcg" alt=""><figcaption></figcaption></figure>

Count how many rollerdoors without motors/auto shutters

COUNTLISTIF(shedresult.rollerdoors.\*.hasmotor=false)

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXdEoDSRBnYu-xc6j9lOA8uBuZ3nV7cn1Oxp2yLjbk1qHXf8ej982i9oKjx6h0KWurxIISmNQU9KsB9XtLBwlg4WOytqXJeWtKviwmM3V831qD6yPtZtFmSCL7x555s-wXpAkiY12tph-B30i4CVAjWlImY?key=XOC2SPeEfDJHl8uZwAWUcg" alt=""><figcaption></figcaption></figure>

Count how many roller gates on the list don't have a motor:

COUNTLISTIF(shedresult.rollerdoors.\*.hasmotor<>true)

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXey7NItE8Co6t4fbe83uC06Do63nBo88gcWBFirLbRIi07hm-ehUDy21D61pr2qh_Hzqn4n3Ssp8pGDooFBz8KpjoXKGvEdT4Llevldy6k9rlWvHcJwst0HlKFEBRga3b_8fM2wGoazcOh9-_AFvmaH2uDD?key=XOC2SPeEfDJHl8uZwAWUcg" alt=""><figcaption></figcaption></figure>

Count how many rollerdoors have chains or have motors in the front wall:

COUNTLISTIF( AND ( OR (shedresult.rollerdoors.\*.hasmotor, shedresult.rollerdoors.\*.haschain), shedresult.rollerdoors.\*.wallidentifier="Front"))

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXecFqYrsPoxsCFDAZwN3fgr0H2c0qx-aKmnFmGMrDb3AV0jZHJPNHRsOIWqY-L-hTNCfjSYRvpWdmohPw3nr6XINgASttRaV9pOBjlDIFtbMmoVJu-q-9fmFbNCZ2W0GvCukp9fwdyGgdl1ep83AjtmuZ97?key=XOC2SPeEfDJHl8uZwAWUcg" alt=""><figcaption></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://shedmate.gitbook.io/shedmate-help/setting-up-shedmate/costing-database-and-pricing-calculations/variables/mathematical-functions/sumlistif.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.
