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

General tips for writing formulas

Thank Kuovonne for creating this content!
Here some tips for writing formulas:
Understand the data type that each field type uses for formulas: text, number, date, array. Note that the data type for a field varies depending on context. Single-selects are treated as text in formulas, but are objects in scripting. There are hints as to data type by looking at a cell value (text is left aligned and numbers are right aligned), but you cannot tell the difference between some data types just by looking at cell values. Also, learn how to convert from one data type to another.
Read the and refer back to it when you have a question about a particular function. This is the vocabulary of formulas, and the more vocabulary that you have memorized, the easier it is to find the right words to say what you want. Know the data type of each input parameter and the data type of the output.
Understand the grammar of formulas. No space between a function name and its open parenthesis. Commas between parameters.No trailing comma after the last parameter. The importance of straight quotes around hardcoded text.
Understand how to nest one formula inside another. Knowing data types (of both inputs and outputs) and where to put the commas is essential for this. Use a multi-line style of writing formulas to make nesting clear.
Understand “truthy” and “falsy” values for IF() conditions. The number zero, empty strings, BLANK(), FALSE(), ERROR() are all falsy.
Know if you are working with an array or not. Often lookups are arrays. Arrays often behave in unexpected ways in formulas.
There usually are multiple ways to do things in code, but some ways are better than others. Features of a good formula include producing correct results, being easy to understand, and avoiding excessive calculations.
Even though formulas are code, there is no explicit support for comments or for assigning values to variables.
Keep writing formulas. The more you do it, the easier it gets.
Test your formulas as much as possible. Test typical cases. Test edge cases. Test blank values. Test error conditions.
Work to understand every word and piece of punctuation in a formula.
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.