Excel - ARRAYTOTEXT Function



ARRAYTOTEXT Function

The ARRAYTOTEXT function retrieves an array comprising string values from a targeted cell range. It transforms all the numeric, logical, and Boolean values into a text form. The ARRAYTOTEXT function has recently been introduced in Microsoft Excel 365. However, the ARRAYTOTEXT function is not compatible with older versions of Microsoft Excel.

Compatibility

This prominent ARRAYTOTEXT function is compatible with the various versions of the MS Excel −

  • Excel for Microsoft 365
  • Excel for Microsoft 365 for Mac
  • Excel for the web

Syntax

The syntax of the ARRAYTOTEXT function is as follows −

=ARRAYTOTEXT(array, [format]) 

Arguments

You can use the following arguments with the ARRAYTOTEXT function −

Argument Description Required / Optional
Array It denotes the cell range where non-text values will be transformed into string values. If any cell contains text values, its values will not be altered. Required
Format It indicates the binary value 0 or 1. By default, its value is 0, specifying the general format. If it equals 1, it represents the strict format, where the array is enclosed in curly braces, and special characters and delimiters are included to separate the arrays elements. Optional

Points to Remember

  • If the second argument contains no binary value, the ARRAYTOTEXT function will return #VALUE! Error.

Examples of ARRAYTOTEXT Function

Practice the following examples to learn the use of the ARRAYTOTEXT function in Excel.

Example 1

Step 1 − Consider the sample dataset comprising two columns named Array and Sales. Write the following data as given below

Excel ARRAYTOTEXT Function 1

Step 2 − Place the cursor on the C10 cell in Excel to apply the ARRAYTOTEXT function, which will transform the array into a text string. Enter the formula "=ARRAYTOTEXT(B3:C9)" to convert the values or array into text in one cell, then press the Enter key to display the result, as shown below.

Excel ARRAYTOTEXT Function 2

Excel ARRAYTOTEXT Function 3

Step 3 − In the Excel sheet, locate the pointer in any cell, like C11, to apply the ARRAYTOTEXT function. Enter the formula "=ARRAYTOTEXT(A7:B13,1)" to convert the values or array into text surrounded in double quotes in one cell, then press the "Enter" key to obtain the result.

Excel ARRAYTOTEXT Function 4

Excel ARRAYTOTEXT Function 5

As you can notice in the screenshot, the values in each row are separated by a semicolon, each text is encapsulated in double quotes, and the complete array is enclosed in curly braces as we are using the strict format.

Example 2

If the second argument contains no binary value, the ARRAYTOTEXT function will return #VALUE! Error.

Solution

You can enter the formula "=ARRAYTOTEXT(B3:C9,5)" in the C10 cell and press Enter. Here, the second argument is 5, which is not valid.

Excel ARRAYTOTEXT Function 6

Therefore, the ARRAYTOTEXT function will retrieve the VALUE! Error.

Excel ARRAYTOTEXT Function 7

Conclusion

The users may use the accessible instance to show how they can use the ARRAYTOTEXT function to convert the array or ranges into a text string in one cell. It can display the string in double quotes, but it cannot show the numbers in double quotes because it can only apply to the string format in the version of Excel 365. The users can use its syntax or functions to display the results for the rows and columns.

Advertisements