When preparing marketing copy, meta descriptions for web publishing, SMS broadcasts, or strict database exports in Microsoft Excel, text length limits are strictly enforced. Exceeding a character threshold—such as 160 characters for text messages or 30 characters for product titles—can result in truncated copy or rejected database imports.
Excel includes the simple and efficient LEN function (short for length) designed specifically to measure the exact character count of any cell instantly.
Method 1: Counting Total Characters (Including Spaces)
To count the total number of characters, letters, punctuation marks, and spaces inside a cell:
- Click into an empty cell alongside your text (e.g. click
B2next to text inA2). - Type the formula:
=LEN(A2) - Press Enter. Excel evaluates the cell and returns the numeric count (e.g.
42). - Double-click the green fill handle in the lower-right corner of cell
B2to copy the formula down your dataset.
Method 2: Counting Characters Excluding Spaces
If your character limit applies strictly to letters and numbers without counting whitespace, combine LEN with the SUBSTITUTE function to strip spaces before calculating length:
- Enter this formula into your target cell:
=LEN(SUBSTITUTE(A2, " ", "")) - Press Enter. The
SUBSTITUTEfunction replaces all space characters with empty strings, andLENreturns the count of visible characters only.
Method 3: Adding Conditional Formatting for Character Limits
To flag cells that exceed your allowable character limit automatically:
- Highlight your source text column (e.g.
A2:A100). - Go to Home > Conditional Formatting > New Rule.
- Select Use a formula to determine which cells to format.
- Enter the rule formula (for a 60-character limit):
=LEN(A2)>60 - Click Format, choose a soft red fill colour, and click OK.
Mastering the LEN function ensures all your content, product codes, and ad copy comply with character boundaries before publishing.