OĞUZ EROL · MarkdownTR
Open MarkdownClose
Source: https://oguzerol.com/en/automatically-combine-excel-files/

[![Illustrative screen: Combine incoming files into one consistent dataset. Ankara.xlsx · 2 rows. Izmir.xlsx · 3 rows. Map columns. Combined: 5 rows. Keep source file attribution.](https://oguzerol.com/gorseller/hizmet-kapaklari/excel-dosyalarini-otomatik-birlestirme-webapp-v1-en.webp) View full size](https://oguzerol.com/gorseller/hizmet-kapaklari/excel-dosyalarini-otomatik-birlestirme-webapp-v1-en.webp)

# Stop Combining Excel Files by Hand Every Week: Power Query, VSTACK or a Reconciliation App

[Oğuz Erol](https://oguzerol.com/en/about-me/)  |  16 min read

## Key takeaways

- VSTACK only works across identical tab layouts; shifting headers and multi-user uploads require Power Query or a controlled reconciliation application.
- Naive SUM drops text amounts as zero, while standard TRIM misses non-breaking spaces (CHAR 160); Power Query can drop leading zeros after its 200-row sample.
- Under controlled reconciliation, nobody approves a batch they uploaded themselves; every change, override and rollback enters an append-only audit trail.
- Calculations, totals and duplicates run in deterministic code; AI only suggests column and SKU mappings, requiring human approval before database commit.

To combine Excel files reliably, **`VSTACK`** is enough for a handful of identically structured tabs inside one workbook, and **Power Query (`Data > Get Data > From Folder`)** is the right tool for recurring files that land in a folder with a stable schema. When a combined sheet finishes without an error message yet the revenue or unit totals still disagree with accounting, the culprit is rarely the append command itself. It is almost always numbers stored as text in one export, orders typed twice across two sales channels, dropped leading zeros on product codes, or a silently renamed column header.

If your operations or finance team opens web-store exports, distributor spreadsheets and warehouse dispatch files every Monday and pastes them into a master workbook, you have two sound paths: build a **source-versus-combined reconciliation tab** inside Excel first, or move to a **multi-user import and reconciliation web application** that validates every row before anything touches your database. Below, I walk through the exact Excel and Power Query checks first, complete with a downloadable sample `.xlsx` workbook, and then show how a custom reconciliation screen handles a three-source B2B order workflow.

In the compact cover illustration at the top of this page, **Ankara.xlsx holds two rows** and **Izmir.xlsx holds three**; once their date and product columns are mapped and all five records pass validation, the combined output contains **five records**. Real weekly operations are messier. When some rows fail validation or repeat an earlier order, the screen never hides lost rows behind a green success badge, it separates incoming, accepted, duplicate-skipped and review-held counts so the totals reconcile to zero.

## Choose the right level first: when Excel is enough and when it breaks

“Combining Excel files” refers to four distinct jobs in business teams. Picking the wrong method either flattens line-level detail or buys custom software you do not yet need:

| Your actual job | Right built-in Excel / query method | When a custom web application makes sense |
| --- | --- | --- |
| Add up identical summary cells across branch budget sheets | **`Data > Consolidate`** sums by cell position or label; it does not stack transaction rows. | Not needed, Excel’s built-in consolidation handles static summary grids well. |
| Stack 2–5 tabs with identical columns inside one workbook | **`VSTACK`** wrapped in `FILTER` in Microsoft 365 or Excel 2024. | When file counts grow every week or column order shifts between contributors. |
| Append recurring CSV/XLSX exports dropped into a shared folder | **Power Query From Folder** (`Table.Combine`) paired with a row-count and sum reconciliation tab. | When multiple contributors upload files, headings drift, and each user must only view their own branch. |
| Reconcile web orders, distributor spreadsheets and warehouse shipments | Power Query plus the validation formulas below, if one analyst owns a low-volume, stable process. | When cross-channel duplicates, price tolerances, role-based dual approval and batch rollback are required. |

If every file comes out of a single ERP in the exact same layout and one analyst refreshes the report, stay in Power Query. For multi-branch batch rollback and dual-control upload governance, see my [controlled Excel import screen](https://oguzerol.com/en/controlled-excel-import-screen/) guide; if your task is finding key-level deltas between two standalone sheets, use the [comparing and matching two Excel lists](https://oguzerol.com/en/comparing-and-matching-two-excel-lists/) walkthrough instead.

## Downloadable example (.xlsx): four silent combining traps in nine rows

You can inspect every formula in our macro-free, four-sheet sample workbook: [Download the combine Excel files & reconciliation example (.xlsx)](https://oguzerol.com/indir/combine-excel-files-reconciliation-example.xlsx). All order IDs, SKUs and amounts are fictional sample data, with zero macros and zero external links. Formula logic and OOXML cached values were verified independently via Python; this build was not executed inside desktop Microsoft Excel.

The workbook combines **Web_Orders** (5 rows) and **Dealer_Sales** (4 rows) into **Combined_Reconciliation** (9 rows) and compares naive summing against validated reconciliation:

| Source : Row | Raw Order ID | Raw SKU | Qty | Raw Amount | Formula Reconciliation Status |
| --- | --- | --- | --- | --- | --- |
| `Web_Orders : 2` | `WEB-101` | `00410` | 10 | `1,200` | **Valid** (`1,200` accepted) |
| `Web_Orders : 3` | `WEB-102` | `00425` | 5 | `"750"` *(text)* | **Text amount coerced** (`750` accepted; naive `SUM` treats this as `0`) |
| `Web_Orders : 4` | `WEB-103` | `00430` | 8 | `2,400` | **Duplicate order** (`2,400` held; also entered in Dealer_Sales) |
| `Web_Orders : 5` | `WEB-104` | *(empty)* | 2 | `600` | **Missing SKU** (`600` held for review) |
| `Web_Orders : 6` | `WEB-105` | `00450` | 4 | `1,600` | **Valid** (`1,600` accepted) |
| `Dealer_Sales : 2` | `DLR-201` | `00410` | 12 | `1,440` | **Valid** (`1,440` accepted) |
| `Dealer_Sales : 3` | `WEB-103` *(NBSP)* | `00430` | 8 | `2,400` | **Duplicate order** (`2,400` held; non-breaking space stripped) |
| `Dealer_Sales : 4` | `DLR-202` | `425` | 6 | `900` | **Dropped leading zero** (`900` held; not blindly merged with `00425`) |
| `Dealer_Sales : 5` | `DLR-203` | `00460` | 3 | `1,500` | **Valid** (`1,500` accepted) |

Look at the control matrix at the bottom of `Combined_Reconciliation` (`rows 13–19`):

- **Naive `SUM(F2:F10)` on raw amounts:** `12,040`. It silently drops the text-stored `"750"` on `WEB-102` and double-counts `WEB-103` (`2,400 × 2`). No `#VALUE!` error appears, yet the number is wrong in two directions at once.
- **True incoming numeric sum (`SUM(H2:H10)`):** `12,790` (`6,550` Web + `6,240` Dealer).
- **Immediately accepted (5 rows):** `6,490` (`1,200 + 750 + 1,600 + 1,440 + 1,500`).
- **Held in review queue (4 rows):** `6,300` (`2,400 + 600 + 2,400 + 900`).
- **Reconciliation delta (`12,790 - 6,490 - 6,300`):** **`0`**. Every single incoming unit and row is accounted for.

## Practical Excel & Power Query formulas before you build software

If you stay in spreadsheets for now, add an explicit audit layer beside your combined data rather than trusting an error-free paste or refresh.

### 1. Stacking identical sheets with VSTACK

When a few tabs share the exact same column order in Microsoft 365 or Excel 2024, combine them dynamically while filtering out blank trailing rows ([Microsoft VSTACK documentation](https://support.microsoft.com/en-us/excel/functions/vstack-function), checked 29 October 2026):

```
=FILTER(VSTACK(Web_Orders!A2:E200,Dealer_Sales!A2:E200),VSTACK(Web_Orders!A2:A200,Dealer_Sales!A2:A200)<>"")
```

**Where it breaks:** `VSTACK` aligns purely by column position. If `Dealer_Sales` puts `Unit_Price` in column C while `Web_Orders` puts `Qty` in column C, `VSTACK` stacks prices on top of quantities without warning. Whenever column names or positions vary, switch to Power Query or a mapped import profile.

### 2. Stripping non-breaking spaces, coercing text numbers and catching duplicates

In our downloadable workbook (`Combined_Reconciliation`), column C holds the raw order ID, column D the raw SKU (formatted as Text `@`), and column F the raw amount:

```
G2 (Clean Order ID) : =TRIM(SUBSTITUTE(C2&"",CHAR(160)," "))
H2 (Numeric Amount) : =IF(ISNUMBER(F2),F2,VALUE(TRIM(SUBSTITUTE(F2&"",CHAR(160)," "))))
I2 (Key Count)      : =IF(G2="",0,COUNTIF($G$2:$G$10,G2))
J2 (5-Digit SKU OK) : =AND(D2<>"",LEN(TRIM(D2&""))=5)
```

IDs copied from web portals or HTML emails frequently carry `CHAR(160)` (non-breaking space), which standard `TRIM` leaves untouched ([Microsoft TRIM reference](https://support.microsoft.com/en-us/office/trim-function-410388fa-c5df-49c6-b16c-9e5630b479f9)). Two edge cases deserve attention: if your order references can contain literal `*` or `?` characters, `COUNTIF` treats them as wildcards unless escaped with `~` (or replaced by `SUMPRODUCT(--EXACT(G2,$G$2:$G$10))`); and `VALUE` depends on your machine’s regional decimal separator, meaning `"1.250,50"` versus `"1,250.50"` must be normalised explicitly when combining international distributor files.

### 3. Three guardrails for Power Query From Folder

[Power Query’s folder combine workflow](https://learn.microsoft.com/en-us/power-query/combine-files-overview) (checked 29 October 2026) builds a sample transformation from one file and applies it across every eligible file via `Table.Combine`. To keep it honest in production:

1. **Override automatic type detection (`Changed Type`):** Power Query inspects only the first 200 rows by default. Lock identifier and SKU columns to `Text` explicitly so `"00425"` never turns into `425`.
2. **Never enable `Skip files with errors` silently:** If a regional distributor renames `"Net Amount"` to `"Discounted Total"`, letting the query fail loudly is far safer than publishing a weekly sales report with an entire region missing.
3. **Add a companion file-count query:** Compare the raw row count per source file against grouped row counts in the final combined output after every refresh.

## B2B weekly scenario: reconciling Web CSV, distributor Excel and warehouse dispatch

*Fictional sample data.* Consider a mid-sized B2B industrial fastener and bearing distributor selling through both a self-service web portal and four regional dealers, while fulfilling orders from a warehouse management system (WMS). Across Day 1 to Day 5 of a sample workweek, three exports arrive for Monday morning reconciliation:

- **`web-orders-w1.csv`:** **312 order rows** exported from the B2B web store, totalling **`EUR 486,200`**.
- **`dealer-sales-w1.xlsx`:** **428 order rows** consolidated from four regional distributors, with a true numeric value of **`EUR 714,500`** (19 rows worth `EUR 38,400` in one dealer’s sheet were stored as text strings, causing a naive spreadsheet `SUM` to display `EUR 676,100`).
- **`warehouse-dispatch-w1.xlsx`:** **718 shipment lines** exported from the WMS, used to cross-check dispatched quantities and agreed unit prices.

Incoming order volume across Web and Dealer files is **`740` rows** worth **`EUR 1,200,700`**. Under the old copy-and-paste routine, the `EUR 38,400` in text cells vanished from the sum, 14 web orders (`EUR 29,600`) that regional reps had also typed into their dealer sheets were counted twice, and 11 rows (`EUR 18,900`) from the North distributor misaligned when someone renamed `"Net Amount"` to `"Discounted Total"`. Management received an unverified `EUR 1,191,900` headline figure and spent month-end hunting down invoice discrepancies.

[![Multi-source order combine and reconciliation screen mockup for Import Batch B-204: 740 incoming rows (EUR 1,200,700) split into 697 accepted (EUR 1,124,800), 14 duplicate skipped (EUR 29,600) and 29 exception queue rows (EUR 46,300), featuring an AI column-mapping suggestion awaiting human approval and row-level source traceability.](https://oguzerol.com/gorseller/web-uygulama/combine-excel-reconciliation-en.webp)](https://oguzerol.com/gorseller/web-uygulama/combine-excel-reconciliation-en.webp)

Multi-source order combine and reconciliation screen mockup (Batch #B-204). Incoming rows equal accepted plus duplicate-skipped plus held exceptions before any record is committed. *Fictional sample data.*

When the operations coordinator uploaded the files into the custom reconciliation screen as **Batch `#B-204`**, zero rows were written directly to the live database. The preview partitioned all 740 rows into four exact buckets:

| Reconciliation bucket | Row count | Value (EUR) | System action & trace |
| --- | --- | --- | --- |
| **Accepted (ready to commit)** | 697 | 1,124,800 | 19 text-stored amounts (`EUR 38,400`) coerced via profile rule; SKUs and dispatch prices verified. |
| **Duplicate skipped (cross-channel)** | 14 | 29,600 | Clean order key matched an existing web-portal order; authoritative web record kept, dealer duplicate logged and skipped. |
| **Exception queue: renamed column** | 11 | 18,900 | `"Discounted Total"` in North dealer sheet flagged; AI suggested mapping to `net_amount`, held pending finance approval. |
| **Exception queue: price & missing SKU** | 18 | 27,400 | 12 rows (`EUR 19,200`) differed by >2% from warehouse dispatch price; 6 rows (`EUR 8,200`) lacked a valid catalog SKU. |
| **Total (Incoming = Accepted + Skipped + Held)** | **740** | **1,200,700** | **Reconciliation delta: 0 rows, EUR 0.** |

**Operational decision reached:** The finance controller approved a partial commit of the 697 clean rows (`EUR 1,124,800`) so weekly cash-flow and replenishment reporting went out at 09:30 on Day 1. Confirming the North distributor’s column mapping released the 11 held rows (`EUR 18,900`) later that morning, while the 12 price-delta rows exposed an outdated regional price sheet before erroneous invoices were issued.

## Matching rules and exception-queue boundaries

A reliable combining application never guesses silently. Thresholds below are **my recommended starting defaults**, calibrated with your team during scoping:

| Edge case | What manual paste / naive query does | What the reconciliation screen enforces |
| --- | --- | --- |
| **Same file uploaded twice under a new filename** | Appends every row a second time. | Checks file content hash (SHA-256) against committed batches and blocks duplicate batch creation. |
| **Same order present in both Web CSV and Dealer XLSX** | Counts both rows because filenames differ. | Enforces cross-source deduplication on normalised business key (`channel_ref + order_id + line_no`). |
| **Partial warehouse dispatch (many-to-one lines)** | Flags false mismatches against full order total. | Aggregates multiple WMS shipment lines per order line before checking quantity and unit-price parity. |
| **Unit-price discrepancy across sources** | Keeps whichever row appeared first. | Holds any line exceeding **my starting recommendation of 2% or EUR 25** variance in the price-review queue. |
| **Renamed or shifted column heading** | Pulls wrong column by position or aborts entire refresh. | Isolates the affected file, proposes a candidate mapping, and waits for an authorised approver. |

## Roles, permissions and immutable audit trail

In a shared master workbook, whoever can paste rows can also overwrite historical numbers or tweak a formula. In a multi-user web application, permissions are enforced at the database layer, anchored by separation of duties: **nobody can approve an import batch or profile rule change that they uploaded or edited themselves.**

| Role | Visibility scope | Upload & exception editing | Batch & schema approval | Export access |
| --- | --- | --- | --- | --- |
| **Branch / Dealer Contributor** | Only their own branch or distributor batches | Uploads files, fixes their own held rows | Cannot approve batches | Own branch rows & error list |
| **Sales Operations Specialist** | All incoming files and exception queues | Uploads multi-source files, prepares partial commits | Cannot approve batches they uploaded | Combined preview & exception CSV/XLSX |
| **Finance Controller** | All batches, price variances and audit logs | Requests corrections; does not edit raw source cells | Approves or rolls back batches prepared by others | Verified ERP / accounting export |
| **Executive / Auditor** | All reconciled summaries and lineage history | Read-only (no data mutation) | Reviews exception trends and rollback logs | Full immutable audit log |

Every row keeps its `batch_id`, `source_filename` and `source_row_number`, and every approval, mapping change, manual override or batch rollback writes an **append-only audit entry** (`user_id`, timestamp, previous value, new value, reason). Rolling back an erroneous upload removes only that batch’s records without disturbing verified data from other branches.

## Where AI helps, where it is forbidden, and regulatory compliance

I never use a language model to **add numbers, check duplicates, evaluate tolerances or enforce user permissions**, every calculation and rule runs in deterministic application and database code. AI is restricted to two assistive tasks where fuzzy text slows people down:

1. **Column-header mapping suggestions:** When an unfamiliar heading such as `"Disc. Net Total"` appears, the model inspects only column headings and data-type patterns to suggest `net_amount`.
2. **Free-text product matching:** When a contributor types a product description instead of a catalog code, the model ranks candidate SKUs from your master catalog for human selection.

**Two hard guardrails apply:** First, **AI suggests and a human approves**, no suggested mapping or SKU ever writes to the database automatically. Second, **no row reaches any model before passing the permission filter and field masking**; customer names, phone numbers, tax identifiers and personal data are stripped before any external API call (or kept entirely offline if you choose no AI integration).

For compliance and record retention:

- **Data protection & cross-border AI APIs:** Under GDPR and international B2B data-processing standards, personal identifiers should remain minimised and covered by appropriate transfer safeguards before any third-party cloud processing.
- **In Turkey:** Cross-border personal-data transfers to external cloud or AI providers are governed by **Law No. 6698 (KVKK) Article 9**, as amended by Law No. 7499 Art. 34 (Official Gazette dated 12 March 2024, No. 32487; effective 1 June 2024), requiring an adequacy decision, standard-contract safeguards or occasional-transfer conditions, which we typically avoid altogether by stripping personal fields before any model prompt. For commercial record retention, **Tax Procedure Law (VUK) Art. 253** mandates 5 years while **Turkish Commercial Code (TTK) Art. 82/1-d and 82/5** mandates 10 years; corporate deployments configure batch and audit-log retention for 10 years.

## Delivery ownership and how we scope the first step

You are not buying a locked SaaS subscription that charges more every time another colleague logs in:

- **Your server, your database:** The application can run on a VPS opened in your company’s name or on your infrastructure. Your data belongs to you and exports cleanly to `.xlsx` or `.csv` at any time.
- **No per-user licence fee:** For small and mid-sized teams, adding regional uploaders, approvers or read-only auditors adds zero per-seat licence fees; ongoing cost is limited to server hosting and any agreed maintenance plan.
- **Full source-code handover:** I deliver the complete source code in a repository accessible to your team, including setup instructions, dependency lists and documented boundaries.
- **When upstream systems change:** Administrators can adjust column mappings directly in the profile UI; structural changes such as direct ERP API connectors are scoped cleanly as follow-on work. Data protection, security, hosting and maintenance terms are documented explicitly during scoping.

We start with a paid, fixed-scope initial work block (see the hourly work packages below on this page) using 2–3 de-identified sample files from your actual workflow. In that first step, we lock down the business row key, tolerance rules, role matrix and a working import-reconciliation prototype before expanding further. Explore the broader architecture on [custom web applications for your team](https://oguzerol.com/en/custom-web-apps-for-your-team/), or send masked sample files via [WhatsApp (+90 549 654 64 89)](https://wa.me/905496546489) or the [contact page](https://oguzerol.com/en/contact/) to scope your workflow.

## Frequently Asked Questions

### Must every branch or distributor file use the exact same column headings?

No. Each source has its own saved import profile mapping local headings (such as `"Item Ref"` versus `"SKU"`) to your canonical database fields. However, two columns that look similar on the surface, such as `"Order Date"` and `"Settlement Date"`, are never merged blindly; field semantics are verified when the profile is approved.

### What happens when a contributor sends a corrected version of last week’s spreadsheet?

A filename alone is never treated as record identity. The screen compares incoming rows by their normalised business key (`source_channel + document_no + line_no`). Unchanged rows are skipped automatically, while rows with modified quantities or amounts are surfaced in a side-by-side diff preview for controller approval, preserving the earlier values in the audit trail.

### Will temporary lock files or archive copies in a folder get imported by mistake?

No. Only files matching the profile’s expected format, naming pattern and active reporting period are eligible. Temporary Excel lock files (`~$`), backup copies and out-of-period rows are filtered out during preview with an explicit skip reason rather than silently entering, or silently vanishing from, your dataset.

### Can our finance team still export the reconciled dataset back to Excel?

Yes. Replacing manual copy-and-paste does not mean giving up spreadsheet analysis. Authorised users can export the reconciled, deduplicated dataset, or the held exception queue, to `.xlsx` or `.csv` at any point for downstream pivot tables, statutory reporting or ERP upload.

[Back to top ↑](https://oguzerol.com/en/automatically-combine-excel-files/#icerik)

WHAT YOU CAN ASK FOR

## How do I work? Work-hour packages

Tell me about your business and what you need on WhatsApp or by phone; we agree on **a work block of somewhere between 5 and 40 hours** and I start doing what is needed. What you get is not a calendar window: it is net working hours spent directly on your business. I can use 40 hours working three days straight, or deliberately spread it out and finish it over a year: whatever the work calls for. I do not spend my time estimating how long something will take, I spend it doing the work; every hour I spend leaves a lasting result in your business. We keep going for as long as you find it useful.

WORK BLOCKS

## Why not monthly? Does a 40-hour block mean one week?

On a fixed monthly fee both sides are watching the wrong thing: you watch a fixed cost, the other side watches how many more contracts like this they can line up. Working by the hour puts us both in front of the same thing: the real value of the work that got done. I know not having an upfront answer to "how much will this cost in total?" is the natural cost of this model. But instead of paying a fixed fee for months to a setup that is not producing results, you only pay for the qualified time spent on your work: and you see exactly where that time went, start to finish. That is why my clients keep coming back.

- **5 hours**: **300 € + VAT** (60€ per hour) · [Choose this block](https://wa.me/905496546489?text=Hi%2C%20I%27d%20like%20info%20about%20the%205-hour%20work%20block.)

- **10 hours**: **500 € + VAT** (50€ per hour) · [Choose this block](https://wa.me/905496546489?text=Hi%2C%20I%27d%20like%20info%20about%20the%2010-hour%20work%20block.)

- **20 hours**: **800 € + VAT** (40€ per hour) · [Choose this block](https://wa.me/905496546489?text=Hi%2C%20I%27d%20like%20info%20about%20the%2020-hour%20work%20block.)

- **40 hours**: **1,400 € + VAT** (35€ per hour) · [Choose this block](https://wa.me/905496546489?text=Hi%2C%20I%27d%20like%20info%20about%20the%2040-hour%20work%20block.)