# 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="https://2402701329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F6wzqgDHj9mZbFxabiEbc%2Fuploads%2FLq9j915mTVPLnVFeMEKq%2FScreenshot%202025-08-26%20at%2011.49.46%E2%80%AFAM.png?alt=media&#x26;token=fdbca3db-dbc5-471b-b28f-6bc8cc6ba6f4" alt=""><figcaption></figcaption></figure>

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