---
title: "DSCOUNT"
url: "https://help.formsfly.com/en/article/dscount"
language: "en"
last_updated: "2024-11-11T11:04:49.777Z"
---

# DSCOUNT

Counts rows in the given Data Source, optionally filtering rows by formula.

### Syntax

`**DSCOUNT(dsId, 'optionalFilterFormula')**`

### Example

```plaintext
DSCOUNT('STAFF')

Add a filter formula using {{this[column]}} to refer to columns.
DSCOUNT('STAFF', '{{this[2]}} = "BOB"') counts rows where 3rd column = BOB
```

### Notes

Refer to the Data Source by its External Id (from the Data Source -> Settings page).

### Related 

[DSSUM](https://help.formsfly.com/en/article/dssum), [DSAVG](https://help.formsfly.com/en/article/dsavg), [DSMAX](https://help.formsfly.com/en/article/dsmax), [DMIN](https://help.formsfly.com/en/article/dsmin), [DSFIRST](https://help.formsfly.com/en/article/dsfirst), [DSLAST](https://help.formsfly.com/en/article/dslast)
