> For the complete documentation index, see [llms.txt](https://www.csvpath.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.csvpath.org/getting-started/the-flightpath-data-examples/counting.md).

# Counting

{% hint style="warning" %}
**Try these examples yourself.** They are built into FlightPath Data. You can download FlightPath Data free from [Microsoft](https://apps.microsoft.com/detail/9P9PBPKZ4JDF) or [Apple](https://apps.apple.com/us/app/flightpath-data/id6745823097) or [Github](https://github.com/dk107dk/flightpath)
{% endhint %}

These examples show different ways to craft CSV and Excel validation rules for counting lines and header values.

There are a number of ways to do similar counts that have separate purposes but which overlap. For example:

* `increment()` adds 1 each N times a match component evaluates to True
* `counter()` adds N each time a match component evaluates to True
* `every()` adds 1 every N-times a value is seen, matching or not

Likewise, summing offers options:

* `sum()` keeps a running count of values in a header
* `count()` keeps a count of matches and, like `every()`, can also count match components it contains
* `subtotal()` tracks the running sum of a header for each value in another header
* `tally()` tracks counts of the values seen in headers or combinations of headers

<figure><img src="/files/a9rmdHtcVtXss1Gaw9tf" alt=""><figcaption></figcaption></figure>

* [Track values](/getting-started/the-flightpath-data-examples/counting/track-values.md)
* [Counters](/getting-started/the-flightpath-data-examples/counting/counters.md)
* [Tallying](/getting-started/the-flightpath-data-examples/counting/tallying.md)
* [Summing up](/getting-started/the-flightpath-data-examples/counting/summing-up.md)
* [Thresholds](/getting-started/the-flightpath-data-examples/counting/thresholds.md)
