How to join a list of cells into one comma-separated string
✓ Verified in LibreOffice 25.8.7.3 ✓ Verified in Google Sheets (2026-08-30)Combine a column of values into a single cell separated by commas, skipping blanks.
The formula
| App | Formula | Notes |
|---|---|---|
| Excel | =TEXTJOIN(", ",TRUE,A2:A4) | Excel 2019+/365. |
| Google Sheets | =TEXTJOIN(", ",TRUE,A2:A4) | Native. |
| LibreOffice Calc | =TEXTJOIN(", ",TRUE(),A2:A4) | Supported; LibreOffice wants TRUE() as a function. |
How it works
TEXTJOIN(delimiter, ignore_empty, range) glues the values together with your chosen delimiter. The second argument TRUE skips empty cells so you never get doubled-up separators.
Verified, not just documented
We ran =TEXTJOIN(", ",TRUE(),A2:A4) in LibreOffice 25.8.7.3 (headless, with forced recalculation) and it returned red, green, blue — 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 red, green, blue 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 Excel.
Functions used
TEXTJOIN · TRUE — see full Excel, Google Sheets & LibreOffice compatibility for each.
Related recipes
- How to concatenate cells that meet a condition (TEXTJOIN IF)
- How to count checked checkboxes
- How to extract numbers from text in a cell
- How to use TEXTJOIN
- How to reverse a text string