FormulaCraft

How to parse a CSV string inside a single cell in Excel and Google Sheets

Topic:Text manipulation

Heads up: Excel and Google Sheets do this differently.

Excel
=TEXTSPLIT(A2, ",")
Google Sheets
=SPLIT(A2, ",")

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Place the CSV string in A2, e.g. apple,banana,cherry,date.
  2. 2In Excel 365: enter =TEXTSPLIT(A2, ",") in B2 — values spill horizontally across B2, C2, D2, E2.
  3. 3In Google Sheets: enter =SPLIT(A2, ",") in B2 — same horizontal spill behavior.
  4. 4To spill values vertically instead, in Excel use =TEXTSPLIT(A2, , ",") (col_delimiter blank, row_delimiter is the comma); in Sheets use =TRANSPOSE(SPLIT(A2, ",")).
  5. 5To trim surrounding whitespace from each value, wrap with TRIM: =TRIM(TEXTSPLIT(A2, ",")) in Excel — TRIM applies to the whole array automatically.

Tips

Need it for your exact data?

Describe your columns in plain English and get the precise formula for your sheet, with the right Excel or Sheets syntax.

Frequently asked

How do I handle a CSV string with a variable number of values?

Both TEXTSPLIT and SPLIT handle variable-length strings automatically — the spill region expands to however many values exist. No need to pre-count.

Can I TEXTSPLIT a range of cells at once?

Yes in Excel: =TEXTSPLIT(TEXTJOIN("|", TRUE, A2:A5), ",", "|") combines all rows first, then splits on commas, using | as the row delimiter. In Sheets, wrap SPLIT in ARRAYFORMULA for a row-at-a-time split.

What if my CSV uses semicolons instead of commas?

Just change the delimiter argument: =TEXTSPLIT(A2, ";") or =SPLIT(A2, ";"). Both functions accept any string as the delimiter.

More on Text manipulation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: