- 08 Nov 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Counting the number of records in linked record fields
- Updated on 08 Nov 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
To count the number of linked records in a field, you can create another field using the "Count" field type. This will automatically provide the number of records that have been linked to a particular record in a designated field. (For a basic overview of the count field type, see "Guide to Formula, Lookup, Count, and Rollup Fields.")
Using the count field
Let's suppose that you have a table of team members, and a table of tasks that need to be completed. Using a linked record field, we can link employees to the tasks to which they've been assigned.
Once you've done this, you'd like to be able to see, at a glance, the number of tasks each employee has been assigned. To do this, create a new field with the count field type (you can title this new field "Tasks Assigned"). You will then be prompted to select name of the field on this table that holds the linked records you would like to count. In this case, the title of that field is "Tasks."
The new count type field you've created will automatically count the number of linked records in the designated field. If you add or remove linked records from the designated field, the count field will automatically update to reflect the new number of records.
Count using a rollup field and formula
For an alternate method of counting linked records, add a rollup field and use the following formula in the rollup settings:COUNTALL(values)
This will count the linked records and allow you to build in other formula functions within the rollup field.
FAQs
Airtable doesn't offer a formula to count the number of selected options. However, suppose you convert the multiple select field into a linked record field (via the "Create new table" option). In that case, you can then use a count field to return the number of selected linked records.
count field
You can also use the below formula workaround, but keep in mind that none of the multiple select field options can have embedded commas:
IF({YOUR MULTIPLE-SELECT FIELD NAME},LEN({YOUR MULTIPLE-SELECT FIELD NAME})-LEN(SUBSTITUTE({YOUR MULTIPLE-SELECT FIELD NAME},",",""))+1)