Help

This Product Ideas board is currently undergoing updates, but please continue to submit your ideas.

Function to count the number of words in a string or text field

cancel
Showing results for 
Search instead for 
Did you mean: 
Maria_Korolov
5 - Automation Enthusiast
5 - Automation Enthusiast

I haven’t been able to find an answer to this on the site, but there doesn’t seem to be a function to count the number of words in a text field. There’s a function to count the number of characters – LEN.

One workaround could be to the count the number of spaces in a text string, but I don’t see a function to do that, either. SEARCH and FIND return the first position of the search string inside the text, not the total number of times the search string occurs.

A word count function is very important for using AirTable as a content management system.

12 Comments
Elias_Gomez_Sai
13 - Mars
13 - Mars

:thinking: It’s explained in the post cited which you have replied to :man_shrugging:

This one:

Samir_Ghosh
7 - App Architect
7 - App Architect

Thanks all, and W_Vann_Hall. The latest formula displays “1” if text field is empty. So slight modification:

IF({English Text},
    LEN(
        SUBSTITUTE(
            SUBSTITUTE(
                SUBSTITUTE(
                    {English Text},
                    "\n",
                    " "
                    ),
                "  ",
                " "
                ),
            "  ",
            " "
            )
        ) -
      LEN(
        SUBSTITUTE(
            SUBSTITUTE(
                {English Text},
                " ",
                ""
                ),
            "\n",
            ""
            )
        ) + 
      1,
    0
)