Split an Excel sheet into multiple files by column value
620 orders split into one file per sales rep, mistyped names caught.
A real run on 14 November 2026, on a Linux computer, using Claude Code with Opus, on a Claude plan. The waiting is sped up; it took 2 min 11 s in real time.
The short answer.
Turn on Filter, choose one value in the column (one rep, one region), copy the visible rows into a new workbook and save; repeat for each value. Tidy the column first, because “Dana Price” and “dana price ” count as different values. VBA macros automate it, if you trust them. Stella (stella.sh) does it without macros and merges names that are clearly the same person.
Stella does this on Windows, Mac and Linux.
What happened.
Six files in about 2¼ minutes. Checked afterwards against an answer key written before the run: one file per rep with exactly that rep's orders (the mistyped names merged in), no file mixing reps, no extra files for a misspelt name, order dates still real dates, and the original workbook unchanged.
The company, its reps and orders are fictitious, made for this run. The work is sped up 7×.
How Stella does it.
- Opens “Orders 2026.xlsx” in Documents: 620 orders for 6 sales reps, a TOTAL row at the bottom and a Reps contact sheet
- Finds 44 orders where the rep's name was typed differently (extra spaces, lower case, all capitals) and matches each to the right rep
- Writes six files, one per rep, each with only that rep's orders under the header and the dates still as dates
- Gives each file only that rep's own row from the Reps sheet, so nobody gets colleagues' email addresses
- Saves them in a new folder next to the original, which is unchanged, checks the totals add up to the original's, and sends nothing
The prompt.
I've got a spreadsheet of all our 2026 orders in my Documents. Split it into a separate Excel file for each sales rep, with only their orders, so I can send each rep their own.
This is the exact prompt from the recording. If your files are somewhere else, say where.
Do it yourself.
Tidy the column first
Add a helper column with =PROPER(TRIM(D2)) next to the rep column and fill down. That folds extra spaces and odd capitals into one spelling. Check the unique values with the filter drop-down.
Filter and copy
Select the header row, Data, Filter. In the tidied column choose one name. Select the visible rows, copy, and paste into a new workbook (File, New); Excel copies only the visible rows.
Save and repeat
Save the new workbook under the rep's name. Back in the original, pick the next name in the filter and repeat. Leave out any total row at the bottom.
Check the counts
Add up the row counts of the new files; they should match the original. A PivotTable of the tidied column gives the count per rep to compare against.
Where it stops.
- Stella decides which spellings are the same person and lists the variants it merged; check that list if two staff have similar names.
- The new files hold values: formulas that point at other sheets won't work in them.
- The workbook's content goes to the AI model you use in Stella as it checks the split; the files are written on your computer.
- Recorded on Linux with free Python spreadsheet tools. A Mac or Windows PC works the same way; the files open in Excel, Numbers or Google Sheets.
Questions.
Can I split into sheets in one workbook instead of separate files?
Yes, ask for one sheet per value. In Excel, a PivotTable's Show Report Filter Pages does it for simple cases.
Can Stella email each rep their file?
It can if you ask and have email connected; in this run it didn't send anything. For one letter or invoice per row instead, see mail merge from Excel to Word.
What if the file is a huge CSV?
Is Stella free for this?
Yes. Free with the ChatGPT or Claude plan you already have. Sign in with your ChatGPT plan, or use your Claude plan through Claude Code, and this task costs nothing extra. New accounts also get a small free trial of Stella’s own models.
Can I control what Stella changes on my computer?
Yes. Stella works on Windows, Mac and Linux with your own files and shows each step in the chat, so you can watch it and stop it at any point. Tell it what it may not do, as the prompts on these pages do (“don't delete anything without asking”). In the Downloads recording it deleted nothing until it was told to go ahead. It also refuses commands that would wipe a whole disk, your home folder or system folders.
Checked against these sources on 14 November 2026.