Add Quotes and Brackets to Comma-Separated Text in Excel
Question details
Convert comma-separated text into a single-cell list with each value in double quotes and the list enclosed in square brackets.

- 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.
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.
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.
In Excel, select B1 next to the source text in A1.
For values separated by a comma and space, enter ="["""&SUBSTITUTE(A1,", ",""",""")&"""]". For values separated by commas without spaces, enter ="["""&SUBSTITUTE(A1,",",""",""")&"""]".
Press Enter. For Offer1, Offer2, Offer3, B1 displays ["Offer1","Offer2","Offer3"].
Select B1 and drag its fill handle down to apply the formula to the remaining rows in column A.

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. Open the spreadsheet: Open WPS Spreadsheets and use Open to select the workbook containing your source text.
- 2. Select a result cell: Click B1 if the comma-separated text is in A1.
- 3. Enter the formula: For comma-and-space separators, enter ="["""&SUBSTITUTE(A1,", ",""",""")&"""]". For commas without spaces, enter ="["""&SUBSTITUTE(A1,",",""",""")&"""]".
- 4. Apply and fill: Press Enter, then drag B1's fill handle down if you need to format more rows.

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.




