How to Use Rollup and Count Fields
The rollup field in Airtable is a powerful way to summarize data from a linked table within the same base. Anytime you need to roll data up into a larger “bucket,” the rollup field becomes invaluable.
The Budget Example
I created a Budget template base to show how Rollup and Count fields work. The base includes three tables:
- Transaction: Tracks individual transactions with amounts and categories.
- Categories: Organizes budget categories to show where spending occurs.
- Budget: Provides an overview of all spending categories and budget allocations.
For example, logging a $42.50 gas purchase under the “Gas & Fuel” category or a $670 brake repair under “Vehicle Maintenance” will roll up to a high-level “Auto and Vehicles” budget category. This rollup would display $712.50 (42.50 + 670) in total.
Rollup Formula
To set up a rollup field, select the linked table and the field from which you want to aggregate values. In this example, we use the Amount field from the Categories table. While various formulas can be applied, the primary formula used here is:
SUM(values)
Count Field
The count field operates similarly to the rollup field, except it returns the number of times a linked record appears, rather than summing values. For example, given two transactions categorized under:
- Gas & Fuel: 1
- Vehicle Maintenance: 1
- Auto and Vehicles: 2 (rollup of both categories)
These formulas offer insights into how individual records in your base contribute to the bigger picture.