ARRAYTOTEXT function

ARRAYTOTEXT converts an array into a delimited text string, with options to control separator style for easy data export.

=ARRAYTOTEXT(array, [format])

Generate a ARRAYTOTEXT formula

Describe what you need. The generator will reach for ARRAYTOTEXT where ARRAYTOTEXT is the right tool, and tell you when it is not.

How to get a better answer
  • Name your columns by letter and by header: "column F (Net Value)" beats "the amount column".
  • State every condition, including the negatives — "not cancelled" changes the formula's shape.
  • Say where the data starts if it is not row 1, and whether it will grow.
  • Check the settings above match your spreadsheet: the wrong argument separator is a syntax error on your machine.

Arguments

How ARRAYTOTEXT reads its arguments
arrayrequiredformatoptionalARRAYTOTEXT
ArgumentRequiredDescription
arrayRequiredRequired. The array to convert to text. Accepts range references, array constants, or array formulas. If empty, returns an empty string.
formatOptionalOptional. Controls the delimiter: 0 for comma-separated (default), 1 for space-separated. Values outside 0–1 return #VALUE! error.

Returns

A text string with array elements joined by the specified delimiter (comma or space).

Availability

Excel: 365 · Google Sheets: Not available

Worked examples

1. Export a campaign record as comma-separated text

CampaignChannelSpendClicksConversions
Summer SaleEmail$50002500125
=ARRAYTOTEXT(A2:E2, 0)

Result: Summer Sale,Email,$5000,2500,125

The formula converts the Summer Sale campaign row into a single comma-separated text string. Each cell from the range becomes one element in the output. This format is directly compatible with CSV systems and text-based data interchange.

2. Convert channel list to text with space delimiter

CampaignChannelSpendClicksConversions
Summer SaleEmail$50002500125
Q3 PushSocial Media$3000180090
Black FridayPaid Search$45003200160
=ARRAYTOTEXT(B2:B4, 1)

Result: Email Social Media Paid Search

The formula extracts the Channel column (B2:B4) and joins the three values with spaces instead of commas. Format parameter 1 produces a more readable list format for reports or documentation. The output is a single line with elements separated by spaces.

3. Convert spend values to text for logging or audit trail

CampaignChannelSpendClicksConversions
Summer SaleEmail$50002500125
Q3 PushSocial Media$3000180090
Black FridayPaid Search$45003200160
=ARRAYTOTEXT(C2:C4)

Result: $5000,$3000,$4500

Without specifying the format parameter, it defaults to 0 (comma-separated). This extracts the Spend column across all three campaigns and joins them with commas. Useful for creating audit logs, concatenating related values, or preparing data for systems that expect comma-delimited input.

Common errors

Which ARRAYTOTEXT error are you seeing?
ARRAYTOTEXT returned an error#VALUE!
Change the format parameter to either 0 (for comma-separated output) or 1 (for space-separated output). If calculating the format dynamically, add validation to ensure it results in 0 or 1.
#REF!
Verify that the range reference points to existing cells with data. Update the formula if columns or rows were moved or deleted. Use the Name Box to confirm the range is valid before running the formula.
#SPILL!
Ensure the cell where you're entering the formula and surrounding cells are free of obstructions. If the array is very large, consider breaking it into smaller chunks. Clear any content in cells adjacent to your formula location.
ErrorWhy it happensHow to fix it
#VALUE!The format parameter is a number other than 0 or 1, such as format=2 or format=−1.Change the format parameter to either 0 (for comma-separated output) or 1 (for space-separated output). If calculating the format dynamically, add validation to ensure it results in 0 or 1.
#REF!The array argument references cells that no longer exist, such as a deleted row or column, or an invalid range reference like A1:A0.Verify that the range reference points to existing cells with data. Update the formula if columns or rows were moved or deleted. Use the Name Box to confirm the range is valid before running the formula.
#SPILL!The function attempted to return a multi-cell result in a location where a spill is not allowed, or there are obstacles in adjacent cells blocking the output.Ensure the cell where you're entering the formula and surrounding cells are free of obstructions. If the array is very large, consider breaking it into smaller chunks. Clear any content in cells adjacent to your formula location.

Tips and when to use something else

  • Format 0 (comma-separated) is ideal for CSV exports and systems expecting standard delimited data; format 1 (space-separated) is better for human-readable lists and documentation.
  • Combine ARRAYTOTEXT with CHOOSEROWS or CHOOSECOLS to export only specific campaigns or metrics instead of entire datasets.
  • For custom delimiters beyond commas and spaces, use TEXTJOIN instead, which offers full control over how array elements are joined.
  • Remember that ARRAYTOTEXT returns a single text string in one cell; if you need to spread array values across multiple cells, use TOCOL or TOROW instead.

Frequently asked questions

Can I use ARRAYTOTEXT to convert an entire table with both headers and data?
Yes, you can pass a range that includes headers and multiple rows. ARRAYTOTEXT joins all values in sequence using your chosen delimiter. However, the result is a single line; if you need multi-row formatted output, consider exporting directly to CSV format instead.
What's the difference between ARRAYTOTEXT and TEXTJOIN?
ARRAYTOTEXT is simpler and limited to two preset delimiters (comma or space). TEXTJOIN is more flexible, allowing any custom delimiter, and gives you options to skip empty cells. Choose ARRAYTOTEXT for quick, simple conversions; use TEXTJOIN when you need more control.
If my campaign names contain commas, will ARRAYTOTEXT break the output?
Yes, commas in your data will not be escaped or quoted. The output would be ambiguous. If your source data contains the delimiter character, use format 1 (space-separated) instead, or switch to TEXTJOIN with a different delimiter.
Does ARRAYTOTEXT work with spilled arrays from other functions like UNIQUE or FILTER?
Yes, ARRAYTOTEXT accepts the output of any function that returns an array, including UNIQUE, FILTER, and SORT. This lets you convert filtered or deduplicated campaign lists directly to text without intermediate steps.

Need a different formula?

The full generator is not scoped to one function — describe any spreadsheet problem and it will pick.

Open the formula generator

Reviewed 2026-09-17