Skip to content
Kuovonne's Guide to Airtable
  • Pages
    • Kuovonne's Guide to Airtable
      • Fields
        • Overview of fields types
          • Editable Field Types
          • Computed Field Types
          • Field Types by Formula Data Type
          • Field Types in Scripting
        • Specific field types
          • Formula fields
            • Demystifying Formulas (DareTable 2022)
          • Rollup fields
          • Select fields
          • Attachment fields
            • Uploading Attachments
            • Attachment Size
            • Attachment URLS
            • Thumbnails
        • Converting Field Types
        • Naming fields
        • Metadata fields
          • Simple Metadata Fields
          • Data Validation
          • Additional Dependencies
          • Original Record URL (Thumbprint) Field
          • Column Divider Fields
          • DareTable 2023 Presentation
        • Field dependencies
      • Formulas
        • Formula Field Reference
        • Writing Formulas
          • Using AI to Write Formulas
          • General tips for writing formulas
          • Testing for Blank Values
          • Drafting Formulas in Parts
          • Function versus Operator
          • Typing Special Characters
          • Commenting Formulas
          • Formulas to avoid
        • Formatting Formulas
          • Basic Rules
          • Nested IF formulas
          • SWITCH Formulas
          • Operators
        • Specific Formulas
          • Ranges of Numbers Values
          • Comma Separated List of Fields Values with Optional Fields
          • Earliest / latest date across columns
          • List Fields Values (one per line) with Optional Fields
          • Rounding a date to the half year
          • Url of Interface Page for a record
          • Removing varying items from a list
        • Data Type Conversion in Formulas
          • Text to Numbers
          • Numbers to Text
          • Data type conversions with Dates
        • Troubleshooting Formulas
          • Formulas that won't save
          • Hiding or showing #ERROR!
          • Troubleshooting date/time/duration formulas
          • Troubleshooting numeric formulas
          • Troubleshooting formulas with lookups
          • Troubleshooting text formulas
      • Automations
        • Triggering automations
          • Triggering automations for typed values
          • Triggering automations on existing records
        • Sending Emails
          • Ways to send emails
          • Using links in emails
          • Emailing Attachments
        • Accessing updated record values
        • Third party automations
        • Managing automation runs
      • Templates
        • Templates for record values
        • Templates using field values
      • Controlling Access
        • Sharing a base
        • Access control considerations
        • Techniques for limited access
          • Airtable interface
          • Share link access
          • Synced table
          • Prefilled forms + Automations
          • 3rd party portal
          • 3rd party webhook
        • Preventing base duplication
      • Specific Solutions
        • Most recent form submission for ermail
        • Email digest of a person’s records
        • Sum of Multiple Select choices
        • Link to multiple records based on select choices
        • Dropping Lowest Score (top 4 of 5)
        • Identify the position of a record in a linked record field (top 4 of 6)
        • Sequential Numbering of Records
        • Ending a list of rollup items with ", and"
        • Table ID in a formula
        • Latest/earliest date across several fields
        • Associating People with Records
        • First Tuesday of the Previous Month
      • Miscellaneous
        • Web API Calls for External Integrations
        • Getting paid to work with Airtable
        • Hiring a consultant
        • Airtable Communities
        • Making major changes to a base
      • Suggestion for this guide

Identify the position of a record in a linked record field (top 4 of 6)

Thank Kuovonne for creating this content!

Inspiration

If your linked record field is sorted, your individual linked records might want to know their position.
This information is useful in situations such as on the Airtable community forums. The user wanted to sum the best 4 out of 6 scores, or the best 4 out of 7 scores.

Finding a child record’s position with back-and-forth rollups

Start with creating a formula field in the [Children] table that shows the Record ID of the child record.
image.png
image.png
In the [Parents] table, create a rollup of the {Record ID} of the linked children records.
image.png
image.png
Back in the {Children} table create a rollup of the rollup that calculates the position of the record based on the position of the record ID in the list.

image.png
image.png

How the final rollup works

The list of record IDs in the rollup reflects the order in which the records are linked. The first record ID starts with the first character in the text string. Because record IDs are always the three letters rec followed by 14 alphanumeric characters, and record IDs are separated by commas, each subsequent record ID starts 18 characters later than the previous one.
ARRAYJOIN(values) gets the list of record IDs as a text string. No text is actually joined since there is only one parent record.
The FIND() function finds the position of the current record ID in the list of record IDs: 1, 19, 37, 55, etc.
The inner SUM() subtracts one from the position of the record ID in the text string so that the result is a multiple of eighteen: 0, 18, 36, 54, etc.
Divide the previous number by eighteen to get sequential numbers: 0, 1, 2, 3, etc.
The outer SUM() adds one to the list of sequential numbers so that positions start at one: 1, 2, 3, 4, etc.

Notes on the system

You cannot use the {Position} in a formula for the primary field of the child record because that would cause a circular reference.
This system will not work if a single child record could be linked to multiple parent records.
My screen captures show the {Position} field formatted as a decimal to show that the positions are accurate. If you do not subtract and add one in the formula, your results might look okay if they are displayed as an integer, but they will be off.
I like a multi-line format for the final formula. You may find a single line format easier to read.
image.png

Summing only the top 4 scores

Summing only the top 4 scores now requires
an automation to ensure that all linked records are always sorted with the top scores first, such as my .
a conditional rollup that sums only the first four linked records, and optionally checks to ensure that there are at least four linked scores
image.png
image.png
Thank Kuovonne for creating this content!

Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.