Home › Guides › Comma Separated List to Column (Excel, Sheets)
Someone sends you ava@example.com, ben@example.com, cleo@example.com in one long line, or an export gives you a list of IDs on a single row, and you need them one per line so you can sort them, compare them or paste them into a spreadsheet. This guide shows the quickest way to split a comma separated list into a column in each common tool, and the one situation where a simple split goes wrong.
=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(A1, ","))))=TRIM(TEXTSPLIT(A1, , ","))If the list is in an email, a document or a web page, you do not need a spreadsheet. Copy it, paste it into the converter and the column appears as you type. The useful settings are:
ben@example.com does not end up with a leading space.You can also remove duplicates and sort at the same time, which is usually the next thing you want. Everything runs in your browser, so a list of customer emails or internal IDs never leaves your computer.
Put the comma separated text in A1. Then in another cell:
=ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(A1, ","))))
SPLIT cuts the text at each comma and spreads the pieces across a row. TRANSPOSE turns that row into a column. TRIM removes the spaces left after each comma, and ARRAYFORMULA lets TRIM work on all the pieces at once.
One trap: SPLIT treats every character in the delimiter as a separator by default. If you write SPLIT(A1, ", ") it splits on commas and on spaces, so “New York” becomes two cells. Use just "," and let TRIM handle the spaces, as above.
Excel 365 and Excel 2021 have TEXTSPLIT. Its arguments are the text, the column delimiter, then the row delimiter, so putting the comma in the third position sends the pieces down rows:
=TRIM(TEXTSPLIT(A1, , ","))
On older versions there is no formula for it, but the Text to Columns tool plus a paste option does the same job:
| Where | How |
|---|---|
| Notepad++ | Open Find and Replace, set the search mode to Extended, replace , with \r\n. To remove the spaces after commas too, use the Regular expression mode and replace ,\s* with \r\n. |
| Visual Studio Code | Turn on regular expressions (Alt+R) and replace ,\s* with \n. |
| PowerShell | "ava, ben, cleo" -split ",\s*" prints one item per line. |
| macOS or Linux | echo "ava, ben, cleo" | tr -s ', ' '\n' splits on commas and spaces. |
The tr command splits on every comma and every space, like Sheets does by default, so it also breaks multi-word items. Use it for single-word values only.
All of the methods above cut at every comma. That is correct for a plain list such as IDs or email addresses. It is wrong when an item itself contains a comma and has been protected with quotes, as CSV files do:
"Smith, John","Jones, Amy",Lee
This is three items, but a plain split produces five pieces, with stray quote marks. The online converter and the formulas above split at every comma and do not understand quotes. If your data looks like this, open the file in Excel or Google Sheets as a CSV instead (File → Open, or Data → From Text/CSV), because spreadsheet importers understand the quoting rules. Split on a different separator if you can: if your source uses semicolons or tabs between items, choose that in the converter instead.
Once the items are in a column you can tidy them. Common next steps:
Paste it into the List Converter, choose Comma as the input separator and New line as the output separator. In Google Sheets use =ARRAYFORMULA(TRIM(TRANSPOSE(SPLIT(A1, ",")))); in Excel 365 use =TRIM(TEXTSPLIT(A1, , ",")).
In Excel 365 or 2021, TEXTSPLIT(A1, , ",") returns them down a column. In older versions, use Data, Text to Columns with a comma delimiter, then copy the row and use Paste Special, Transpose.
A doubled comma or a trailing comma creates an empty item. Turn on Remove empty items in the converter, or wrap the result in a formula that filters blanks.
Not with a plain split. Items such as "Smith, John" need a CSV-aware importer, which spreadsheets provide through Data, From Text/CSV or by opening the file directly.
No. It runs as JavaScript in your browser and your text is never sent anywhere, so it is safe to use with private lists.