Function Problems

Add Quotes and Brackets to Comma-Separated Text in Excel

Anum MushtaqAnum Mushtaq Nov 18, 2026 869 views

Question details

Convert comma-separated text into a single-cell list with each value in double quotes and the list enclosed in square brackets.

Add Quotes and Brackets to Comma-Separated Text in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
A cell contains text such as Offer1, Offer2, Offer3, and the user wants a bracketed, quoted version.
Observed behavior
The desired result is ["Offer1","Offer2","Offer3"] in one cell.
Before you start

Check which cell contains the source text and whether its values are separated by a comma and space or by a comma alone. The formulas below assume the source is in A1 and that individual values do not contain commas or double quotes.

Solution 1Recommended

Use SUBSTITUTE to format the list in Excel

Use a formula to add double quotes around each value and square brackets around the full list.

1
Select an output cell

In Excel, select B1 next to the source text in A1.

2
Enter the matching formula

For values separated by a comma and space, enter ="["""&SUBSTITUTE(A1,", ",""",""")&"""]". For values separated by commas without spaces, enter ="["""&SUBSTITUTE(A1,",",""",""")&"""]".

3
Apply the formula

Press Enter. For Offer1, Offer2, Offer3, B1 displays ["Offer1","Offer2","Offer3"].

4
Fill other rows

Select B1 and drag its fill handle down to apply the formula to the remaining rows in column A.

Use SUBSTITUTE to format the list in Excel
Formula limitations: Choose the formula that matches the separator used consistently in the source cell. These formulas do not escape double quotes or distinguish commas inside individual values.
WPS Spreadsheets

Format Comma-Separated Text in WPS Spreadsheets

Use the same SUBSTITUTE formula in WPS Spreadsheets to turn a comma-separated cell into a quoted, bracketed list.

  1. 1. Open the spreadsheet: Open WPS Spreadsheets and use Open to select the workbook containing your source text.
  2. 2. Select a result cell: Click B1 if the comma-separated text is in A1.
  3. 3. Enter the formula: For comma-and-space separators, enter ="["""&SUBSTITUTE(A1,", ",""",""")&"""]". For commas without spaces, enter ="["""&SUBSTITUTE(A1,",",""",""")&"""]".
  4. 4. Apply and fill: Press Enter, then drag B1's fill handle down if you need to format more rows.
Add quotes and brackets without retyping each valueFill the formula down to format multiple rowsOpen and edit Microsoft Excel XLS and XLSX files
microsoft office alternative - wps office

Frequently Asked Questions

Which formula should I use if there are no spaces after the commas?

With the source in A1, enter ="["""&SUBSTITUTE(A1,",",""",""")&"""]" in another cell. This replaces each comma with a closing quote, comma, and opening quote.

How can I apply the formula to an entire column?

Enter the formula in B1, select B1, and drag its fill handle down alongside the source cells in column A. Excel adjusts the cell references for each row.

Can I replace the original text with the formatted result?

Copy the formula results, select the original cells, and use Paste Special > Values. The formatted text will replace the source without retaining the formulas.

Will the formula work if an individual value contains a comma or double quote?

No. The formula treats every matching comma as a separator and does not escape double quotes. Those values need additional handling before they can form a valid quoted list.