← All how-to recipes

How to truncate text with an ellipsis

✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)

Cap long descriptions at N characters, adding "..." only when something was cut.

The formula

AppFormulaNotes
Excel (desktop)=IF(LEN(A2)>20,LEFT(A2,17)&"...",A2)20 = the cap; 17 = cap minus the 3 ellipsis dots. Adjust both together.
Google Sheets=IF(LEN(A2)>20,LEFT(A2,17)&"...",A2)Identical.
LibreOffice Calc=IF(LEN(A2)>20,LEFT(A2,17)&"...",A2)Identical.

How it works

The IF guard is what makes it polite: short values pass through untouched, and only genuinely long ones get cut to 17 characters plus "..." โ€” so the result never exceeds the 20-character cap and never shows a pointless ellipsis on text that fit anyway. A tidier variant avoids cutting mid-word: =IF(LEN(A2)>20,LEFT(A2,FIND(" ",A2&" ",17))&"...",A2) backs up to a space. Remember this is display text โ€” keep the full value in its own column.

Verified, not just documented

We ran =IF(LEN(A2)>20,LEFT(A2,17)&"...",A2) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned The quick brown f... — exactly the expected result. We then ran the same formulas in Google Sheets, executed 2026-08-30: a formula-only workbook goes into Google Drive, which converts it to a Sheet and recalculates every formula with Google’s own engine, and comes back out as .xlsx carrying the values Google computed. It returned The quick brown f... for the worked example, the same value LibreOffice produced. Both engines’ numbers on this page are executed results. The Excel formula follows Microsoft’s official documented syntax — we do not run desktop Excel.

Functions used

IF · LEN · LEFT — see full Excel, Google Sheets & LibreOffice compatibility for each.

Related recipes

Related comparisons