# sumif: Sumif Spreadsheet Function for an Array

> sumif (Sumif Spreadsheet Function for an Array) is a 1001fx API function in the group Spreadsheet: POST https://api.1001fx.com/spreadsheet/sumif, 2 credits per call. It works as a ready-made module in Make and n8n or as a plain HTTP call.

Implements a sumif function similar to GSheet and Excel functions. Sum elements of an array by a given criterion.

- Group: Spreadsheet
- Endpoint: `POST https://api.1001fx.com/spreadsheet/sumif`
- Authentication: header `X-API-KEY: YOURSECRETAPIKEY`
- Content type: application/json
- Credits: 2 credits per call
- Ready-made in: Make and n8n
- Docs: https://1001fx.com/functions/sumif

## Parameters

- `data` (array<object>, required) – Data: Array of objects with at least two properties e.g. [{name,score}] each.
- `queryField` (string, required) – Query field: Name of the field in data to look for critera. Case sensitive
- `operator` (enum, optional, one of `eq`, `gt`, `ge`, `lt`, `le`, `ne`, default `eq`) – Comparison Operator: Comparison operator. Defaults to eq
- `criteria` (string, required) – Criteria: Criteria to look for must be number or string
- `sumField` (string, required) – Sum field: Name of the field in data to sum up. Case sensitive.
- `ignoreCase` (boolean, optional, default `true`) – Ignore case sensitivity: Sets case sensitivity for criteria operation. Defaults to true

## Example: Sum

```bash
curl -X POST 'https://api.1001fx.com/spreadsheet/sumif' \
  -H 'X-API-KEY: YOURSECRETAPIKEY' \
  -H 'Content-Type: application/json' \
  -d '{"data":[{"name":"Alice","score":1},{"name":"Bob","score":2},{"name":"Charlie","score":4},{"name":"Dave","score":8},{"name":"Bob","score":16.5}],"queryField":"name","sumField":"score","operator":"eq","criteria":"Bob","ignoreCase":false}'
```

Answer (HTTP 200):

```json
{
  "result": 18.5
}
```
