Array to text
Syntax:¶
ARRAYTOTEXT(array, [format])
- array: The array or range of values that you want to convert into text.
- format (optional): Specifies the text format to return:
0(default): Generates implicit text, which is generally a compact, human-readable representation of the array.1: Generates explicit text, including explicit syntax (e.g., curly braces{}to clearly represent arrays).
Description:¶
The ARRAYTOTEXT function in Excel converts an array (or range) of values into a text string. This function is useful
when you need to display array data as a text representation or when working with dynamic arrays in formulas.
The format parameter allows control over how the output text is structured:
- Implicit format (0): Provides a simple, human-readable text form of the array.
- Explicit format (1): Provides a detailed text representation, which includes syntax for arrays, such as
{}for defining arrays explicitly.
This function is commonly used for text manipulation, debugging formulas, or for generating array text in specific formats.
Examples:¶
-
Basic Example (Implicit Format):
- If
A1:C1contains{1, 2, 3}, the function outputs:"1 2 3"
- If
-
Explicit Format with
ARRAYTOTEXT:- If
A1:C1contains{1, 2, 3}, the function outputs:"{1,2,3}"
(the array is explicitly represented with curly braces and commas.)
- If
-
Multi-dimensional Array Example (Explicit Format):
- If
A1:C2contains: The function outputs:"{1; 2; 3; 4; 5; 6}"
- If
-
Default Behavior Omission of
format:- Uses the implicit format.
IfA1:C2contains:{1, 2, 3; 4, 5, 6}, this outputs:"1 2 3 4 5 6"
- Uses the implicit format.
Notes:¶
- The
ARRAYTOTEXTfunction was introduced in Excel 365 and Excel 2021 as part of the modern dynamic array functionality. - When using explicit format (
1), the output will always use text syntax representation that respects array notation (e.g.,{}for arrays, commas for columns, semicolons for rows). - This function is particularly useful for debugging array formulas or visualizing results of dynamic arrays.
- If the array is empty, the function returns an empty string (
""). - Implicit format is more user-friendly, while explicit format is better for precise data representations.