Formulyo

Excel + Google Sheets · AI prompt

AI wrote this formula for me

Total characters minus characters without spaces = number of spaces. Plus one = words.

The formula

=LEN(TRIM(A2)) - LEN(SUBSTITUTE(A2, " ", "")) + 1

What each part means

Example

Before
AB
1TextWords
2Thank you for your order
3Send the report by Friday
4Meeting moved to 3pm
After
AB
1TextWords
2Thank you for your order5
3Send the report by Friday5
4Meeting moved to 3pm4

Step by step

  1. Open ChatGPT, Gemini or Copilot.
  2. Describe your columns and what you want, in your own words.
  3. Paste the formula it gives you in cell B2: =LEN(TRIM(A2)) - LEN(SUBSTITUTE(A2, " ", "")) + 1
  4. Press Enter and drag it down.

Where it works

The same formula in other languages

Get 1 formula a day, free

Plus a free weekly planner template for Excel and Google Sheets. Unsubscribe in 1 click.

✓ Done! Check your inbox to confirm.

Want ready-made templates? See the Formulyo pack →

Keep learning