ARRAYTOTEXT function
Turns a range or array into one line of text, either as a readable list or in strict array-constant form you can paste into a formula.
Available in Microsoft 365, Excel 2021 and later, Excel for the web, Excel for Mac 2021+
Excel 2021 and laterNot in Google Sheets
Syntax
ARRAYTOTEXT(array, [format])| Argument | What it means | |
|---|---|---|
array | Required | The range or array to convert, e.g. A2:B5 or the result of another formula. |
format | Optional | 0 (default) = concise: values separated by a comma and a space. 1 = strict: curly braces, text in double quotes, , between columns and ; between rows. |
Returns: A single text string describing every value in the array.
How ARRAYTOTEXT works
ARRAYTOTEXT squeezes a whole block of cells into one text value. In its default concise mode it simply lists the values in reading order (left to right, then down), separated by a comma and a space - handy for a quick summary line such as "Items: Pen, Stapler, Folder" or for checking what a dynamic-array formula really returns without letting it spill.
In strict mode (format = 1) the output is written exactly the way an array constant is typed in a formula: wrapped in { }, with text in double quotes, commas between columns and semicolons between rows. You can copy that text and paste it straight into another formula. Numbers are written as their stored value, not as the cell shows them, so a price formatted as $12.50 comes out as 12.5. Logical values become TRUE/FALSE.
ARRAYTOTEXT is the array big brother of VALUETOTEXT, which converts a single value. If you need control over the separator or want to skip blanks, use TEXTJOIN instead.
Examples
1Summarise a small score table
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Score | ||
| 2 | Ana | 82 | Ana, 82, Ben, 91 | |
| 3 | Ben | 91 |
Result: Ana, 82, Ben, 91
Concise mode reads A2, B2, A3, B3 in that order and joins them with , . Text is not quoted.
2Build an array constant you can reuse
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Name | Score | ||
| 2 | Ana | 82 | {"Ana",82;"Ben",91} | |
| 3 | Ben | 91 |
Result: {"Ana",82;"Ben",91}
Strict mode adds braces, quotes the text and uses ; to mark the start of the second row. Copy the result into a formula such as =INDEX({"Ana",82;"Ben",91}, 2, 2) and it works as-is (in a locale that uses ; as the row separator).
3Numbers lose their display format
| A | B | C | D | |
|---|---|---|---|---|
| 1 | Item | Price | ||
| 2 | Stapler | 12.5 | 12.5, 3 | |
| 3 | Folder | 3 |
Result: 12.5, 3
Even if B2:B3 are formatted as currency ($12.50, $3.00), ARRAYTOTEXT writes the stored numbers.
Common errors and how to fix them
| Error | Why it happens | Fix |
|---|---|---|
#VALUE! | format is something other than 0 or 1. | Use 0, 1 or leave the argument out. |
#CALC! | The array argument evaluates to an empty array (e.g. a FILTER with no matches and no if_empty). | Give FILTER an if_empty value or wrap the result in IFERROR. |
Tips
- Wrap a dynamic-array formula in ARRAYTOTEXT, e.g.
=ARRAYTOTEXT(UNIQUE(A2:A50)), to see all of its results in one cell while you debug. - Format numbers first with TEXT inside the array if you want them to look formatted:
=ARRAYTOTEXT(TEXT(B2:B3,"$0.00"))gives$12.50, $3.00. - Empty cells are included as empty items, so a range with blanks can produce
, ,. Use TEXTJOIN withignore_emptyset to TRUE when blanks must be skipped.
Google Sheets
Use TEXTJOIN(", ", FALSE, range) or JOIN(", ", range) to turn a range into one text.
ARRAYTOTEXT in other languages
In a non-English version of Excel the function has a local name. Excel translates formulas automatically when a file is opened in another language.
| Language | Function name |
|---|---|
| Danish | MATRIXTILTEKST |
| Finnish | MATRIISI.TEKSTIKSI |
| French | TABLEAU.EN.TEXTE |
| German | MATRIXZUTEXT |
| Italian | MATRICE.A.TESTO |
| Polish | TABLICA.NA.TEKST |
| Portuguese (Brazil) | MATRIZPARATEXTO |
| Portuguese (Portugal) | MATRIZPARATEXTO |
| Russian | МАССИВВТЕКСТ |
| Spanish | MATRIZATEXTO |
| Swedish | MATRISTILLTEXT |
| Turkish | DİZİMETİN |