Stella
PDFs and Excel

Merge two Excel sheets based on one matching column

150 orders given each customer's email and phone, and four strays marked not found.

Download StellaFree with the plan you already have.

A real run on 13 November 2026, on a Linux computer, using Claude Code with Opus, on a Claude plan. The waiting is sped up; it took 1 min 22 s in real time.

The short answer.

In the sheet you're adding to, use XLOOKUP: =XLOOKUP(C2, Customers!A:A, Customers!C:C, "not found") brings in the matching value, or “not found”. It fails silently when the IDs are stored differently, such as the number 1042 on one side and the text 001042 on the other, or a trailing space; wrap the lookup value in TEXT and TRIM to match them. Stella (stella.sh) matches on the number itself, adds the columns to a copy, and lists the rows with no match.

Stella does this on Windows, Mac and Linux.

What happened.

Merged in under a minute and a half. Checked afterwards against an answer key written before the run: all 150 orders kept, all 146 matched orders with the right email and phone (including customer numbers with leading zeros or spaces), the 4 unknown customer numbers given nobody's details and marked not found, and both original spreadsheets unchanged.

The shop, its orders and customers are fictitious, made for this run. The work is sped up 3×.

How Stella does it.

  1. Opens both spreadsheets in Downloads: 150 orders, and 60 customers stored in a different order
  2. Notices the customer numbers are written differently on each side: plain numbers in the orders, six-digit text with leading zeros in the customer list, and some with a stray space
  3. Matches on the number itself, so 1042, “1042 ” and 001042 all find the same customer
  4. Adds email and phone to every order in a new file, and writes “not found” on the four orders whose customer number isn't in the list
  5. Names those four orders and their numbers, and leaves both original files unchanged

The prompt.

I have an October orders spreadsheet and a Customers spreadsheet in Downloads. Add each customer's email and phone number to every order, matching on the customer number, and write 'not found' on any order whose customer number isn't in the customer list.

Paste it into Stella and press Enter.

This is the exact prompt from the recording. If your files are somewhere else, say where.

Do it yourself.

  1. Put both sheets in one workbook

    Copy the customer list into a new tab of the orders workbook (call it Customers). Lookups across two open files work too, but break if one moves.

  2. Check how the IDs are stored

    Click an ID on each side. If one side shows 001042 or is left-aligned, it's text; 1042 right-aligned is a number. They won't match each other as they are. Also look for spaces at the end.

  3. Write the lookup

    In a new column next to the first order: =XLOOKUP(TEXT(TRIM(C2),"000000"), Customers!A:A, Customers!C:C, "not found") brings in the email. TRIM drops spaces, TEXT pads the number to six digits like the customer list. Make a second column with Customers!D:D for the phone.

  4. Fill down and check

    Double-click the fill handle to copy the formulas down. Filter the new column for “not found” and look at those rows: are they test entries or real missing customers? Spot-check a few matches by hand.

  5. Freeze the results

    Copy the new columns and Paste Special, Values, so the file no longer depends on the Customers tab. Older Excel without XLOOKUP: use =IFERROR(VLOOKUP(…, Customers!A:D, 3, FALSE), "not found").

Where it stops.

  • Stella matches on the column you name. If the two sheets use different kinds of IDs (an account number on one, an email on the other), say what to match on.
  • It added the details to a new file and left both originals alone. It also offered to tidy the ID column; that's your call.
  • Both spreadsheets' contents, including customer emails and phone numbers, go to the AI model you use in Stella. The merge runs on your computer.
  • Recorded on Linux with a free Python library. The result is an ordinary .xlsx for Excel on Windows or Mac.

Questions.

Why does VLOOKUP return #N/A when the value is there?

Usually a type mismatch (number vs text, often leading zeros) or a hidden space. Use TRIM and TEXT (or VALUE) so both sides are the same kind, as above.

XLOOKUP or VLOOKUP?

XLOOKUP is simpler: it can look left, has a built-in “not found” value and defaults to exact match. VLOOKUP needs FALSE as the last argument and a column number.

Can I merge more than two files?

For stacking files with the same columns, see combine Excel files into one sheet. To see what changed between two versions, compare two Excel files.

What if a customer appears twice in the list?

Lookups take the first match. Remove duplicate rows from the customer list first.

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 13 November 2026.

Stella