How to truncate text and add an ellipsis in Excel
Formula (Excel and Google Sheets)
=IF(LEN(A2)>$E$1,TRIM(LEFT(A2,$E$1-3))&"...",A2)Cut long text and add "...": =IF(LEN(A2)>20,TRIM(LEFT(A2,17))&"...",A2). Text within the limit stays unchanged.
- Result on the example
- one result per row in
B2, filled down toB6 - Works in
- Excel 2024 and Microsoft 365
- Google Sheets
- Same formula
See it work
The formula is already in B2, filled down to B6. Change any input and the result updates, or edit the formula to experiment.
How it works
The three dots take 3 characters, so LEFT keeps $E$1-3 and the result is never longer than the limit. TRIM removes a space left at the cut, so you get "Ergonomic office..." and not "Ergonomic office ...". Short titles fail the LEN test and come back unchanged.
=IF(LEN(A2)>$E$1,TRIM(LEFT(A2,$E$1-3))&"...",A2)Result"Ergonomic office..."
A2"Ergonomic office chair with lumbar support"The value in A2.
LEN(A2)42LEN: Number of characters.- text
A2"Ergonomic office chair with lumbar support"
- text
$E$120The value in E1.
LEN(A2)>$E$1TRUEThe > operator tests greater than.
$E$1-317The - operator subtracts.
LEFT(A2,$E$1-3)"Ergonomic office "LEFT: Characters from the start of text.- text
A2"Ergonomic office chair with lumbar support" - num_chars
$E$1-317
- text
TRIM(LEFT(A2,$E$1-3))"Ergonomic office"TRIM: Removes extra spaces, leaving single spaces between words.- text
LEFT(A2,$E$1-3)"Ergonomic office "
- text
TRIM(LEFT(A2,$E$1-3))&"...""Ergonomic office..."The & operator joins as text.
IF(LEN(A2)>$E$1,TRIM(LEFT(A2,$E$1-3))&"...",A2)"Ergonomic office..."IF: Returns one value if a test is true, another if false.- logical_test
LEN(A2)>$E$1TRUE - value_if_true
TRIM(LEFT(A2,$E$1-3))&"...""Ergonomic office..." - value_if_false
A2"Ergonomic office chair with lumbar support"not used
- logical_test
In Google Sheets
The same formula works in Google Sheets: =IF(LEN(A2)>$E$1,TRIM(LEFT(A2,$E$1-3))&"...",A2). We ran it in Google Sheets mode on the same data and it returns the same results.
Other ways to do it
Each one was run on the same example sheet.
| Formula | Result | When to use it |
|---|---|---|
| =IF(LEN(A2)>$E$1,TEXTBEFORE(LEFT(A2,$E$1-2)," ",-1)&"...",A2) | Ergonomic office..., Desk lamp, Adjustable...…Different result | Excel 365: cuts back to the last whole word so no word is broken. "Adjustable..." instead of "Adjustable standi...". |
Common mistakes
- Forgetting to subtract 3 makes the result 3 characters over the limit.
- A single word longer than the limit has no space to cut at, so the whole-word version returns #N/A. Add a fallback:
TEXTBEFORE(…," ",-1,,,LEFT(A2,$E$1-3)).
Try it yourself
Same data, empty answer cell. Your formula is graded instantly, then re-checked on changed data, so a typed-in number won't pass.
Truncate text and add an ellipsis
B2, shorten titles longer than the limit in E1: keep the first characters and end with "...", so the result fits the limit. Fill down to B6.Questions
How do I use a single ellipsis character instead of three dots?
Type … (Alt+0133 on Windows) inside the quotes and subtract 1 instead of 3.
How do I flag titles that are too long instead?
Use =IF(LEN(A2)>$E$1,"Too long","OK").
Checked by running on 2026-10-30: every formula and result on this page was calculated by the Spreadsheet Practice formula engine, in both Excel and Google Sheets modes.