# Split an Excel sheet into multiple files by column value

> Markdown version of https://stella.sh/how/pdf-excel/split-excel-sheet-into-multiple-files for agents and LLMs.
> Make one Excel file per salesperson, region or client with filters, or let Stella (stella.sh) split the sheet with no macros and catch names typed inconsistently.

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.

- Checked: 14 November 2026
- Stella does it on: Windows, Mac, Linux

## Stella doing it

Recorded 14 November 2026 on Linux (Omarchy) with Claude Code with Opus, on a Claude plan.
Result: 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×.

Video (52 s): https://stella.sh/media/proofs/pdf-excel/split-excel-sheet-into-multiple-files/proof.mp4

Transcript:

- 0:00 Stella on a Linux computer. A workbook of 620 orders for six sales reps is in Documents.
- 0:01 The prompt: a separate Excel file for each rep with only their orders.
- 0:19 Stella replies that the files will go in a folder next to the original, with a count per rep.
- 0:24 Grouping orders by rep, sped up 7×.
- 0:37 Done: six files, totals matching the original, 44 mistyped names merged, nothing sent.

What Stella does:

1. Opens “Orders 2026.xlsx” in Documents: 620 orders for 6 sales reps, a TOTAL row at the bottom and a Reps contact sheet
2. Finds 44 orders where the rep's name was typed differently (extra spaces, lower case, all capitals) and matches each to the right rep
3. Writes six files, one per rep, each with only that rep's orders under the header and the dates still as dates
4. Gives each file only that rep's own row from the Reps sheet, so nobody gets colleagues' email addresses
5. 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 to paste

```text
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.
```

## Split it yourself

1. **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.
2. **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.
3. **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.
4. **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 Stella 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](https://stella.sh/how/documents/mail-merge-excel-to-word).

**What if the file is a huge CSV?**
See [split a CSV file into multiple files](https://stella.sh/how/pdf-excel/split-csv-file-into-multiple-files).

**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.

Sources: [Microsoft: Filter data in a range or table](https://support.microsoft.com/en-us/office/filter-data-in-a-range-or-table-01832226-31b5-4568-8806-38c37dcc180e).

## Related problems

- [Split a CSV file into multiple files that open in Excel](https://stella.sh/how/pdf-excel/split-csv-file-into-multiple-files.md)
- [Combine multiple Excel files into one sheet](https://stella.sh/how/pdf-excel/combine-excel-files-into-one-sheet.md)
- [Summarize a spreadsheet by category and month, with totals](https://stella.sh/how/pdf-excel/summarize-spreadsheet-by-category.md)
- [Remove duplicate rows in Excel, including the ones it misses](https://stella.sh/how/pdf-excel/remove-duplicate-rows-in-excel.md)
- [Convert bank statement PDFs to Excel](https://stella.sh/how/pdf-excel/bank-statement-pdf-to-excel.md)
- [Reduce PDF file size when it's too large to email](https://stella.sh/how/pdf-excel/compress-pdf-too-large-to-email.md)

Get Stella: https://stella.sh/download. Free with the ChatGPT or Claude plan you already have.
