Plan Availability | All plan types |
Required permissions | Owners/Creators - Can add, delete, duplicate, rename, and customize fields |
Platform(s) | Web/Browser, Mac app, and Windows app (with some additional limited support on mobile) |
Understanding rollup fields in Airtable
A rollup field performs calculations, creates aggregates leveraging formula functions on specific cells from records that are linked together. A simple example in Airtable would look like this:
Records from a marketing campaign table tracking a percentage of email open rates are connected via a linked record field to a table tracking different marketing campaign project types.
In the campaign project types table, all of the email marketing campaigns are linked to a single “Email campaign” record. Other marketing campaign type records are also present.
A rollup field is added in the campaign project types table to roll up the values in the email open rate field. The rollup aggregation formula is
AVERAGE(values)
so that all of the email open rates for every connected email campaign are rolled up. As more records are linked (or unlinked) over time, the rollup value will dynamically update.
Adding rollup fields in Airtable
NOTE
We strongly recommend naming your rollup field anything other than "Values." If you title your field "Values," a new rollup field is created that attempts to create a new field to aggregate data named "Values." But if a field named "Values" already exists, the rollup field will use the existing field instead of creating a new one.
Visit your Airtable homepage.
Create or open your preferred base.
Add or edit a field.
Search for and select Rollup.
Click Rollup.
A configuration window opens, allowing you to set up and customize your rollup field.
Click the ⌄ icon under the “Select rollup source” section and choose your preferred source (The table containing the values that you want to roll up.
Click the ⌄ icon under the “Articles by category field you want to roll up” and choose your preferred field.
After selecting the preferred field you want to roll up, Airtable populates an aggregation formula in the field below the “Aggregation formula which rolls up the values in each linked record” section. To modify replace or modify that formula, check out the Inserting rollup functions in Airtable rollup fields section.
In addition, you can optionally limit which kinds of records are used in your rollup field. To limit record usage, check out the Limiting record usage in Airtable rollup fields section below.
Click Create field.
Limiting record usage in Airtable rollup fields
Click the icon to the left of “Only include linked records from the Articles by category table that meet certain conditions.”
Click the ⌄ icons and select your preferred filtering options.
Click Create field or Save.
NOTE
Only records that meet your selected conditions are used to produce a value in the rollup field. Check out our Conditional counts, lookups, and rollups support article to learn more.
Inserting rollup functions in Airtable rollup fields
After selecting the preferred field you want to roll up, Airtable populates an aggregation formula in the field below the “Aggregation formula which rolls up the values in each linked record” section.
Click inside the field below the “Aggregation formula which rolls up the values in each linked record” section and delete the existing formula.
Enter your preferred aggregation formula.
Click Create field or Save.
Rollup field functions reference
Name | Description | Examples |
AND | Returns true if all the values are true |
|
ARRAYCOMPACT | Removes empty strings and null values from the array. Keeps "false" and strings that contain one or more blank characters. |
=> [1, 2, false, 5] when values are [1, 2, false, null, 5] |
ARRAYFLATTEN | Flattens the array by removing any array nesting. All items become elements of a single array. Use when you have a lookup of a lookup for example. |
=> [1, 2, 3, false] when values are [[1, 2, "", 3],[false]] |
ARRAYJOIN | Join all the values into a single comma-separated string. |
=> 1; 2; 3 when values are [1, 2, 3] |
ARRAYSLICE | Returns a subset of the array from the first index number—starting from 1. Optionally specify an end index to stop. Use negative numbers to begin to count from the end of the array. |
ARRAYSLICE(values, 2, 3) => ["B", "C"] when values are ["A", "B", "C", "D"]
|
ARRAYUNIQUE | Return only unique items. |
=> "[1, 2, 3]" when values are [1, 2, 3, 3, 2, 1] |
AVERAGE | Mean average of the values. |
|
CONCATENATE | Joins together the text values into a single text value. |
|
COUNT | Count only non-empty numeric values. If you want to count all records, use COUNTALL. |
|
COUNTA | Count the number of non-empty values. This function counts both numeric and text values. |
|
COUNTALL | Count the number of linked records. Choosing any column of the linked table will produce the same result. This function counts all values including blank records. |
|
MAX | Returns the largest of the given numbers. |
|
MIN | Returns the smallest of the given numbers. |
|
OR | Returns true if any one of the values is true. |
|
SUM | Sum together the values. |
|
XOR | Returns true if and only if odd number of values are true. |
|
FAQs
Does filtering affect rollup fields?
By default, any filtering conditions applied in a table's view will not affect a rollup of those records in another table. A rollup field will roll up data from all records in the linked table, regardless of whether or not those records have been filtered in that table's views.
If you want to use a rollup field but have it only aggregate values from certain linked records in each cell, you can use a conditional rollup.
How do I format a rollup field's output?
To learn more about formatting, check out our Number-based fields in Airtable support article.