Module 06: Make the work repeatable
LESSON 23 / Advanced · ABOUT 30 MIN

Append orders, merge customer names, and check the row count

Use three small source tables to distinguish stacking records from matching keys, including a missing customer and a duplicate-key trap.

Before you start

Windows desktop Excel 2016 and later, using ordinary Append, Left Outer Merge and worksheet-table sources. No fuzzy matching or Data Model is required. Microsoft 365 Mac and Excel for the web have different source and editor availability; these are Windows instructions, not a cross-platform compatibility guarantee.

Useful first: Turn one CSV import into a repeatable query

By the end, you can…
  • Choose append for additional records and merge for matching attributes.
  • Preserve an unmatched left-hand record for investigation.
  • Detect a lookup table that multiplies order rows.
YOUR PRACTICE FILE

Small data. A result you can check.

Synthetic January data. February and the two-row customer mapping are fully specified in the first section.

Download practice data
View the raw practice data
OrderID	CustomerID	Amount
O101	C01	40
O102	C02	60

01Create the three sources

Paste the sample at January!A1:C3. On February, enter the table below at A1:C3. On Customers, enter CustomerID and CustomerName in A1:B1, then C01/Ana in row 2 and C02/Bo in row 3. Create an Excel table from each exact range and name them JanOrders, FebOrders and CustomerMap respectively.

For each table, click inside it and choose Data > From Table/Range. Set identifiers and names to Text, amounts to Whole Number. Name the queries JanQuery, FebQuery and CustomerQuery. For each, Home > Close & Load To > Only Create Connection keeps the source sheets separate from the later result.

OrderIDCustomerIDAmount
O103C0225
O104C9915

02Append creates more records

Open JanQuery from Data > Queries & Connections. In the editor choose Home > Append Queries > Append Queries as New. Select JanQuery followed by FebQuery and name the new query AllOrders. Four order records should total 140: January contributes 100 and February 40.

Append aligns fields by header names, not worksheet positions. Renaming Amount to Amount_USD in just one source creates a different field with missing values elsewhere; it does not translate the schema. Keep the contract identical. Appending also does not remove repeated orders, so accidentally adding January twice would require investigation.

03Merge adds matching attributes

With AllOrders selected, choose Home > Merge Queries > Merge Queries as New. Put AllOrders on the left and CustomerQuery on the right. Select CustomerID in each, choose Left Outer and confirm. Name the result EnrichedOrders. Expand only CustomerName from the nested table column, then sort OrderID ascending and Close & Load.

There must still be four rows totaling 140. O101 gets Ana; O102 and O103 get Bo. O104 has no matching customer, so its expanded name is null in the query, usually a blank cell after loading. That missing name is an exception to resolve, not a reason to discard its 15 of sales.

OrderIDAmountCustomerName
O10140Ana
O10260Bo
O10325Bo
O10415null (unmatched)

04Check the lookup's uniqueness

If CustomerMap contains two C02 records, expanding the merge produces two copies of each matching order. The result becomes six rows totaling 225, even though the original orders still total 140. Reconcile counts and amounts after expansion, and inspect key uniqueness before trusting the output. Do not blindly deduplicate orders to conceal an ambiguous customer mapping.

PUT IT INTO PRACTICE

Resolve the missing customer, then observe a deliberate duplicate-key failure.

  1. Append C99/Cia to CustomerMap, confirming the table expands. Refresh EnrichedOrders and wait for completion.
  2. Temporarily append another C02 customer row named Bo alternate; refresh the final query again.
  3. Remove that deliberate duplicate from the source table and refresh to restore the valid mapping.
Show the worked answer

After adding C99, four enriched rows total 140, with O104 named Cia.

The duplicate C02 produces six rows totaling 225. Removing it restores four rows and 140.

Check your work
  • CustomerQuery must read the expanded source table.
  • A matching name is not enough: a repeated key can silently inflate monetary totals.
CHECK YOUR UNDERSTANDING

One question before you move on.

Which operation should add February's order records beneath January's?

Ready for the next step?

Mark this lesson when you can explain the idea and reproduce the practice result.

Your checklist stays on this browser.
NEXT LESSONBuild a monthly report with a repeatable import and a reconciliation

Keep the skill close.

FIELD GUIDEPower Query Append vs Merge: Stack Rows or Match Columns?FIELD GUIDECombine CSV Files in Excel with Power Query: A Folder WorkflowFIELD GUIDECompare Two CSV Files in Python: Find Added and Missing IDsWORKSPACE TOOLCompare two listsWORKSPACE TOOLRemove duplicates

Reference notes

These lessons use original examples. Check Microsoft’s documentation for details and platform-specific options.

Prepared September 13, 2026 · Column Harbor editorial team. Menu locations and available functions can vary by Excel version.