- 08 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
Word and character count in Airtable
- Updated on 08 Dec 2023
- 1 Minute to read
- Print
- DarkLight
- PDF
You can use a formula field to count the number of words, or characters, in another field, and even display a customized message depending on the length.
Introduction
All plan types | |
Platform(s) | Web/Browser, Mac app, and Windows app |
Related reading |
Counting characters in Airtable
Let's say that you have a base setup to track social media content, and want to make sure your tweets don't exceed the 280 character limit. You can use a formula like the following to output the character count of the text field:
LEN({Long Text})
Note that {Long Text}
is the name of our field in the table below— you will need to input the name of your text field if you copy this formula.
Displaying messages based on character count in Airtable
Now, let's say that you're not so interested in the exact character count, but more so that you're under the 280 character limit. Here's an example of an IF statement you can write to check for this and output a message depending on the character count:
IF(LEN({Long Text})>280, "❌Over Limit", "✅Under Limit")
Using this formula, you'll see either ❌Over Limit or ✅Under Limit for each record depending on the character count in the field your formula is watching.
To reiterate, {Long Text}
is the name of our field in the table above— you will need to input the name of your text field if you copy this formula.
Counting words in Airtable
For a different workflow, you may be writing editorial content and want to ensure your articles don't exceed a certain word count. You can use a similar formula to count the number of spaces in a text field, which in turn will give you a total count of words.
IF({Text Field}=BLANK(), 0, LEN({Text Field}) - LEN(SUBSTITUTE({Text Field}, ' ', ''))+1)