Sub topic 5
Combining values into one string with JOIN
This chapter assumes you can enter formulas, reference cells and ranges, and write text in double quotes inside a formula. You also need to know what a function argument is. By the end you will be able to combine values from cells, ranges, and literals into one string. You will know how JOIN treats numbers, blanks, and errors, and where it differs from & and TEXTJOIN.
What JOIN does
SPLIT breaks one string into pieces. JOIN does the opposite: it takes several values and glues them into a single string, placing a delimiter between each pair. The delimiter is the text that separates the values, such as a comma, a space, or a line break.
The syntax is:
JOIN(delimiter, value_or_array1, [value_or_array2, ...])delimiteris the text placed between values. It can be a string in double quotes, a reference to a cell that holds the delimiter, or the empty string"".value_or_array1is the first thing to join. It can be a single value, a cell, or a range.- Further arguments are optional. You can add as many as you need.
The delimiter comes first. People who know CONCATENATE or & often expect it last, and swapping the order is the most common JOIN mistake.
A first example
Suppose A2:A5 holds four tags, one per row:
| Cell | Value |
|---|---|
| A2 | red |
| A3 | green |
| A4 | blue |
| A5 | yellow |
This formula joins them into one cell:
=JOIN(", ", A2:A5)The result is red, green, blue, yellow. Notice that the delimiter is two characters, a comma and a space. JOIN inserts the whole string between values exactly as you typed it. It adds nothing before the first value or after the last, so you never get a stray trailing comma.
The same function works on a row. =JOIN(", ", A2:D2) joins four side-by-side cells. It reads the range left to right.
Choosing the delimiter
The delimiter can be any text. These are the common choices:
| Goal | Delimiter | Result for red, green, blue | Column | Column | Column |
|---|---|---|---|---|---|
| Readable list | `", "` | red, green, blue | |||
| Machine-friendly list | `","` | red,green,blue | |||
| Pipe-separated | `" \ | "` | red \ | green \ | blue |
| Sentence-like | `" and "` | red and green and blue | |||
| Plain concatenation | `""` | redgreenblue | |||
| One value per line | `CHAR(10)` | red, green and blue on separate lines |
A few notes on this table:
- The pipe is escaped in the table only because a pipe would otherwise end a table cell. In a formula you type
" | ". CHAR(10)produces a line feed. The cell shows the lines only when text wrapping is on. Turn it on with Format > Wrapping > Wrap.- An empty delimiter
""is legal. It makes JOIN behave like plain concatenation of a range, which is something&cannot do without listing every cell.
You can also keep the delimiter in a cell, such as $F$1, and write =JOIN($F$1, A2:A5). Then changing F1 changes every JOIN formula that points to it. That is useful when one sheet builds many joined columns and you may switch from commas to semicolons later.
Several arguments at once
After the delimiter, you can pass more than one value or range. JOIN treats them as one long sequence, in the order written:
=JOIN(" ", B2, C2)If B2 is Ada and C2 is Lovelace, the result is Ada Lovelace. You can mix cells, ranges, and literal text:
=JOIN(", ", A2:A4, "other", C2:C3)This joins the three cells in A2:A4, then the word other, then the two cells in C2:C3, all separated by a comma and a space. Literal text is useful for adding a fixed item to a list without writing a helper cell.
A two-dimensional range such as A2:C4 also works. JOIN reads it row by row, left to right, then moves down. If the order matters, check the first few results before relying on it.
How JOIN treats different kinds of values
JOIN always returns text. Its inputs behave as follows.
Numbers
Numbers are converted to text. =JOIN("-", 2026, 11, 27) returns 2026-11-27. The result is a string, not a number. A joined "1,2,3" cannot be summed. If you later need the number back, see the chapter on turning extracted text into numbers.
Numbers do not keep the cell's display format. A cell showing $5.00 may join as 5. If the format matters, wrap the value with TEXT, as in the next section.
Dates and formatted values
A date is stored as a serial number, and JOIN may give you that number instead of the date you see. Format the values first. TEXT turns a value into a string with a pattern you choose. Because it has to run on every cell in the range, wrap it in ARRAYFORMULA:
=JOIN(", ", ARRAYFORMULA(TEXT(B2:B5, "yyyy-mm-dd")))The result is a list such as 2026-11-27, 2026-12-01, .... Without ARRAYFORMULA, TEXT would work on only the first cell. Always test one joined date before copying the formula down a column.
Blank cells
A blank cell is not skipped. It contributes an empty value, so you get two delimiters in a row. If A3 is empty in the earlier tag list, =JOIN(", ", A2:A5) returns:
red, , blue, yellowThe gap is easy to miss in a long list and causes trouble when another system reads the string. The next chapter shows how to remove blanks with FILTER. For now, remember that JOIN reports the structure of the range faithfully, including the holes.
Empty strings
A formula that returns "" looks blank, but it behaves like any other empty value in JOIN. It also leaves a gap. This matters when the cells you join are themselves formula results, such as extractions that returned nothing.
Errors
If any value in the arguments is an error, such as #N/A or #DIV/0!, JOIN returns that error and no string at all. One bad cell in a range of 500 spoils the whole result. Wrap the source in IFERROR, or clean the range first, to avoid this:
=JOIN(", ", ARRAYFORMULA(IFERROR(A2:A5, "")))This replaces errors with empty strings, which then show up as gaps. Use a visible placeholder such as "?" if you want the problem to stay noticeable.
Using JOIN to change a delimiter
JOIN pairs naturally with SPLIT. Splitting a string and joining the pieces with a different delimiter rewrites the delimiter without touching the data. If A2 holds red;green;blue, then:
=JOIN(", ", SPLIT(A2, ";"))returns red, green, blue. SPLIT produces a row of three cells in memory, and JOIN consumes that row directly. The row does not need to land in the sheet first. This also works if the formula sits in a cell with no room to spill, because JOIN collapses the result into one cell.
JOIN compared with the alternatives
| Tool | Delimiter | Accepts ranges | Skips blanks |
|---|---|---|---|
| `&` operator | Typed between every pair | No, one cell at a time | No |
| `CONCATENATE` | None | No, one cell at a time | No |
| `JOIN` | Once, as first argument | Yes | No |
| `TEXTJOIN` | Once, as first argument | Yes | Yes, with an option |
Use & for two or three known cells, such as =A2 & " " & B2. Use JOIN when the number of values is large or the list is a range, since you write the delimiter once. This tutorial uses JOIN with FILTER to skip blanks, because that approach also lets you decide which values count as blank. TEXTJOIN can be shorter when simply ignoring empty cells is all you need.
Limits and edge cases
- A cell can hold at most 50,000 characters. A JOIN over a very large range can exceed that and produce an error. Join in smaller groups if you hit it.
- JOIN with one value returns that value as text, with no delimiter. This is handy when a list sometimes has a single item.
- The delimiter is literal text. Characters that are special in regular expressions, such as
.or|, need no escaping in JOIN. Escaping matters in the REGEXEXTRACT chapters, not here. - The result of JOIN is one cell. It does not spill. If you see results in neighboring cells, they come from another function.
Troubleshooting checklist
- Wrong or garbled result: check that the delimiter is the first argument.
- Double delimiters such as
, ,: the range has blank cells or empty strings. - The whole cell shows an error: one value in the range is an error. Wrap the source in IFERROR.
- Dates show as five-digit numbers: format them with TEXT inside ARRAYFORMULA.
- Lines do not appear on separate rows: turn on text wrapping.
Exercise
A2:A4 contains the values north, an empty cell, and south. What does =JOIN("/", A2:A4) return, and which formula returns the same list written with a comma and a space between values?
Show answer
The first formula returns north//south, because the empty cell still contributes an empty value and leaves two delimiters in a row. Changing only the delimiter gives =JOIN(", ", A2:A4), which returns north, , south. The blank is still there, and removing it needs FILTER, covered in the next chapter.
Exercise
B2 holds the number 7 and C2 holds the text days. Write a formula that returns 7 days, and say what type of value it returns.
Show answer
=JOIN(" ", B2, C2) returns 7 days. The result is text, not a number, because JOIN always returns a string.