Converts array or range to a text string
=ARRAYTOTEXT(array, [format])
| Parameter | Description |
|---|---|
array |
The array or range to convert to text. |
format |
[optional] Output format. 0 = concise (default), and 1 = strict. |
All arrays in Excel are wrapped in curly brackets {}, and the delimiters between array elements indicate rows and/or columns. In the US version of Exc
{1,2,3} // columns (horizontal)
{1;2;3} // rows (vertical)
The array below shows the numbers 1-6 in three rows and two columns:
{1,2;3,4;5,6} // 3 rows x 2 columns
When format is zero (0), ARRAYTOTEXT will return a concise format. Essentially, the concise format is a plain, human-readable text string separated by
=ARRAYTOTEXT(A1:A3) // returns "Red, Blue, Green"
If the values "Red", "Blue", and "Green" are in the range A1:C1 (i.e., columns instead of rows), the output is exactly the same:
=ARRAYTOTEXT(A1:C1) // returns "Red, Blue, Green"
When format is set to 1, ARRAYTOTEXT will return a text string that is a fully qualified array constant like {"red","blue","green"}. The output will a
=A1:C3
In fact, you can paste the strict output format directly into the formula bar, and Excel will return values to the worksheet in a range that follows t
={"red",1;"blue",2;"green",3}