# TEXTJOIN formula generator

> Describe what you need and get a TEXTJOIN formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested TEXTJOIN examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/textjoin · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

TEXTJOIN joins a list of values with the same delimiter between each one, and can skip blanks.

Describe the task at [TEXTJOIN formula generator](https://spreadsheetpractice.com/tools/formula-generator/textjoin) and get a TEXTJOIN formula for Excel and Google Sheets, tested on real data.

## Tested TEXTJOIN examples

### Make a comma-separated list with quotes for a SQL query

`="'"&TEXTJOIN("','",TRUE,A2:A6)&"'"`

Excel. Result on the sample sheet: 'C-1042','C-1057','C-2290','C-1501','C-7731'. [See it and try it](https://spreadsheetpractice.com/formulas/make-a-quoted-comma-list-for-sql)

### Combine text from two cells

`=A2&" "&B2`

Excel. Result on the sample sheet: 5 rows (C2:C6). [See it and try it](https://spreadsheetpractice.com/formulas/combine-text-from-two-cells)

### Combine cells with a comma and skip blanks

`=TEXTJOIN(", ",TRUE,A2:E2)`

Excel. Result on the sample sheet: 5 rows (F2:F6). [See it and try it](https://spreadsheetpractice.com/formulas/combine-cells-with-comma-skip-blanks)

### Combine a column into one cell with commas

`=TEXTJOIN("; ",TRUE,B2:B8)`

Google Sheets. Result on the sample sheet: ana@ruiz.example; raj@patel.example; kim@ortiz.example; mo@diaz.example; sam@cole.example; eve@lund.example. [See it and try it](https://spreadsheetpractice.com/formulas/combine-a-column-into-one-cell-in-google-sheets)

### Return multiple matching values in one cell

`=TEXTJOIN(", ",TRUE,FILTER(B2:B8,A2:A8=E1))`

Excel. Result on the sample sheet: Aiko, Chidi, Fay. [See it and try it](https://spreadsheetpractice.com/formulas/return-multiple-matches-in-one-cell)

### List the column headers of cells marked with an X

`=TEXTJOIN(", ",TRUE,IF(B2:F2="X",B$1:F$1,""))`

Excel. Result on the sample sheet: 5 rows (G2:G6). [See it and try it](https://spreadsheetpractice.com/formulas/list-headers-of-marked-cells)

### Replace line breaks with commas

`=SUBSTITUTE(A2,CHAR(10),", ")`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/replace-line-breaks-with-commas)

### List all names tied for the highest value

`=FILTER(A2:A8,B2:B8=MAX(B2:B8))`

Excel. Result on the sample sheet: 3 rows (D2:D4). [See it and try it](https://spreadsheetpractice.com/formulas/names-tied-for-highest)

## Questions

### What does the TEXTJOIN formula generator do?

You describe the task in plain English, and it writes the formula, using TEXTJOIN where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does TEXTJOIN do?

TEXTJOIN joins a list of values with the same delimiter between each one, and can skip blanks.

### Can I learn to write TEXTJOIN formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the TEXTJOIN function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
