Every Monday someone opens last week's trading workbook, saves it under a new name, pastes fresh exports over the old ones, nudges a few ranges, fixes the lookups that broke and sends the summary round. The file is the report, the data store and the process manual all at once. Automating it is less about Excel macros than about separating those three jobs, so that the numbers arrive by themselves and Excel is left doing the parts it is good at.
This page sets out a migration in four steps: inventory the workbook, find the system behind each tab, rebuild the calculations as tested models, then decide deliberately what stays in Excel. It ends with a fictional workbook taken through all four, including a side-by-side run that explains every pound of difference between the old file and the new pipeline.
Why the Monday workbook resists automation
A weekly report built in Excel usually grows one fix at a time. A new tab appears when a new export is needed. A VLOOKUP gets wrapped in IFERROR because a blank looked tidier than #N/A. A cell is overtyped because the export was wrong that week and the person who knew why has since moved on. None of that is careless. It is what happens when the person producing the report is also the only control on it.
The trouble shows up when you try to hand it over. Nobody can say which numbers are typed and which are calculated, which tabs come from which system, or what the IFERROR is hiding. Recording a macro to replay the clicks keeps all of that intact and adds a new failure: the macro breaks the first time an export gains a column. The workbook itself has to be taken apart before the job can be automated.
What Excel and Power Query already do well
Be fair to the tools before replacing anything. Power Query, built into Excel for Windows and Mac, is Microsoft's engine for getting and reshaping data. Its overview on Microsoft Learn explains that each transformation is recorded as a step, the steps form a repeatable query, and the source data is not changed. If your weekly report is one export reshaped the same way each time, a Power Query query may be all you need.
Excel can also refresh a connection when the workbook opens or every set number of minutes; both are options on the connection's properties, set out in Microsoft's guide to refreshing an external data connection. The same Microsoft overview notes that scheduled refresh lives in other products, such as Power BI, or has to be driven through the Excel object model.
So the honest test is not whether Excel can automate a report. It is whether your report depends on things a workbook cannot hold safely: several source systems joined together, a history that survives each refresh, tests that stop a bad week going out, and one definition of a measure shared by everyone who opens the file.
Step 1: inventory the workbook
Open the file and label every tab with one role. Then go through the formulas and mark every cell that is typed rather than calculated, because those are the cells a pipeline cannot guess.
| Role | What it looks like | Question to answer |
|---|---|---|
| Pasted export | A raw table someone overwrites each week | Which system, which report, which filters, run when? |
| Lookup | SKU to category, customer to rep, code to region | Does a system already own this mapping? |
| Manual input | Budget, targets, headcount | Who maintains it, and how often does it change? |
| Manual override | A correction typed over a formula or into an adjustments tab | Why was it needed, and who approved it? |
| Output | The summary table, pivot or chart people read | Who reads it, in what format, by when? |
Overrides deserve their own pass. Search for hard-coded numbers inside formulas (for example =SUM(D4:D90)+1250) as well as for tabs named "adj" or "manual". Each one is either a real business adjustment that needs a home or a patch for a data problem that should be fixed at source.
Step 2: find the source behind each tab
For each pasted export and lookup, write down the system, the record and the fields. A weekly trading report typically needs the following, whatever the accounts package is called.
| Source | Record | Fields used |
|---|---|---|
| Accounts system | Sales invoice line | invoice number, invoice date, customer account code, SKU, quantity, net amount |
| Accounts system | Credit note line | credit note number, posting date, invoice credited, SKU, quantity, net amount |
| Product or stock master | Product | SKU, category, standard cost, cost effective-from date |
| CRM or accounts | Customer | account code, account owner (sales rep) |
| Excel, kept | Budget | category, ISO week, budget net sales |
| Excel, kept | Adjustment | week, category, amount, reason, reference, approver |
If the accounts are Xero, the automated Xero reporting page covers that side in detail. If the export comes from your own database rather than a packaged system, see reporting straight from a SQL database. And if the team works in Google rather than Microsoft, the same steps apply to Google Sheets.
Some tabs will have no source. Budgets and approved adjustments usually exist only in the workbook. That is fine; they become inputs, not exports.
Step 3: rebuild the transformations as tested models
Each formula pattern in the workbook becomes a named model with a test aimed at the specific failure that pattern used to hide.
The joins
| From | To | Join key | Old Excel version | What the model does instead |
|---|---|---|---|---|
| Invoice line | Product | SKU | VLOOKUP, wrapped in IFERROR(…,0) | Lists any SKU with no category or cost; never treats cost as zero |
| Invoice line | Customer | customer account code | VLOOKUP on a hand-kept tab | Reads the owner from the system that holds it; flags blanks |
| Credit note line | Invoice line | invoice credited | Pasted underneath the sales lines | Loads by posting date so late credits land in the right week |
| Sales by category | Budget | category + ISO week | SUMIFS | Tests for exactly one budget row per category per week |
| Adjustment | Credit note | reference + amount | None | Rejects an adjustment that repeats a credit already posted |
The formulas
| Measure | Formula |
|---|---|
| Net sales | Σ invoice line net − Σ credit note line net, for the week, excluding VAT |
| Cost of sales | Σ quantity × standard cost, using the cost in force on the invoice date |
| Gross margin | net sales − cost of sales |
| Margin % | gross margin ÷ net sales |
| Variance to budget | net sales − budget |
| Reconciliation gap | Excel figure − pipeline figure, with every pound assigned a cause |
The last line is the one that makes the switch safe. Run both versions side by side for a few weeks and do not retire the paste until each week's gap is fully explained.
Migration plan · 2 November 2026
Excel to pipeline · Stannock Trade Supplies
8 tabs in one workbook.
2 stay in Excel on purpose.
Weekly trading report v14.xlsx inventoried tab by tab, traced to its sources and rebuilt as tested models, then run alongside the old file for 4 weeks.
- Tabs inventoried
- 8
- 4 move to the pipeline
- Kept in Excel
- 2
- Plus 2 outputs still in Excel
- Largest margin gap
- £1,839
- Excel above pipeline, one week
- Weeks explained
- 4 of 4
- 8 differences traced
Workbook inventory: what each tab is and where it goes
| Tab | Role | Source behind it | Decision | Check |
|---|---|---|---|---|
| Sales_Export | Pasted export | Accounts: sales invoice lines | Move to pipelineLoaded from the accounts system on a schedule; staged as stg_invoice_lines | Row count and net total match the accounts system for the week |
| Credits_Export | Pasted export | Accounts: credit note lines | Move to pipelineLoaded with invoices; staged as stg_credit_lines | Credit total matches the accounts system; every credit points at an invoice or is flagged |
| Product_Lookup | Lookup | Stock or product master (if it holds cost); otherwise this sheet | Move to pipelineRead from the product master; dim_product with an effective-from date on cost | Every sold SKU has a category and a cost; gaps are listed, not zeroed |
| Rep_Map | Lookup | Account owner field in the CRM or accounts, where one exists | Move to pipelinedim_customer with rep, read from the system that owns it | No customer with sales this week lacks a rep |
| Budget | Manual input | Nobody else holds it | Keep in Excel, validatedStays in Excel as a locked input sheet, read by the pipeline | Validation: category from a list, week 1–53, amount a whole number ≥ 0 |
| Adjustments | Manual override | Nobody else holds the reason or the approval | Keep in Excel, validatedStays in Excel as a controlled input, read by the pipeline | Validation: reference, reason and approver required; duplicates of posted credits rejected |
| Summary | Output | Formulas over the tabs above | Excel as outputRebuilt as rpt_weekly_trading; refreshed into an Excel file people still open | Parallel run: Excel and pipeline agree, or every difference is explained |
| Board_Chart | Output | Summary tab | Excel as outputSame chart, fed from rpt_weekly_trading | Values match the report table for every week shown |
Lineage before and after the migration
Before: the workbook is the pipeline
- Accounts export (CSV) feeds Sales_Export / Credits_ExportCopy and paste
- Product_Lookup feeds SummaryVLOOKUP on SKU
- Rep_Map feeds SummaryVLOOKUP on account code
- Budget / Adjustments feeds SummarySUMIFS on category and week
- Summary feeds Board_ChartChart range
After: Excel at the edges only
- Accounts system feeds stg_invoice_lines / stg_credit_linesScheduled load
- Product master feeds dim_productScheduled load
- CRM or accounts feeds dim_customerScheduled load
- Budget.xlsx / Adjustments.xlsx feeds input_budget / input_adjustmentsValidated Excel inputs
- All models feeds rpt_weekly_tradingTested joins
- rpt_weekly_trading feeds Weekly trading.xlsx and board chartExcel as output
Parallel run: old workbook against the pipeline
Gap = Excel figure − pipeline figure. A week passes when every pound of the gap has a named cause.
| Week | Net sales Excel / pipeline | Gross margin Excel / pipeline | Gap sales / margin | Causes found |
|---|---|---|---|---|
| W41 | £139,780£141,620 | £45,240 32.4%£44,830 31.7% | −£1,840+£410 |
|
| W42 | £149,500£148,280 | £47,740 31.9%£46,520 31.4% | +£1,220+£1,220 |
|
| W43 | £141,780£142,270 | £44,430 31.3%£43,350 30.5% | −£490+£1,080 |
|
| W44 | £144,260£143,950 | £44,390 30.8%£42,551 29.6% | +£310+£1,839 |
|
Migration steps
7 tests on 7 models
- 01Inventory the workbookList every tab as input, lookup, manual input, override or output, and every cell that is typed rather than calculated.8 tabs; 2 pasted exports, 2 lookups, 1 manual input, 1 override sheet, 2 outputsDone
- 02Find the source behind each tabFor each input and lookup, name the system and the record it came from, or record that no system holds it.4 tabs traced to a system; 2 held only in ExcelDone
- 03Rebuild transformations as tested modelsMove each SUMIFS, VLOOKUP and pivot into a named model with a test for the failure it used to hide.3 models, 7 testsDone
- 04Run both side by sideProduce the report both ways each week and explain every difference before switching off the paste.4 weeks compared; all gaps explainedFor review
- 05Keep Excel where it earns its placeBudget and adjustments stay as validated input sheets; the finished report is still delivered as an Excel file.2 input sheets, 1 Excel outputPlanned
Worked example (illustrative, fictional)
Stannock Trade Supplies is an invented distributor. Its week 44 report (week commencing Monday 26 October 2026) was produced both ways on Monday 2 November.
The workbook. The sales export, pasted at the start of Monday, held £148,620 of invoice lines and £3,410 of credit notes. The Adjustments tab also held a £950 customer rebate. Cost of sales from Product_Lookup came to £99,870.
- Net sales: £148,620 − £3,410 − £950 = £144,260
- Gross margin: £144,260 − £99,870 = £44,390, a margin of 44,390 ÷ 144,260 = 30.8%
The pipeline. It loaded the same invoices, plus a £1,260 price credit posted later on Monday against a week 44 invoice. It ignored the £950 adjustment because the rebate was already in the accounts as a credit note inside the £3,410. Three new SKUs, £2,184 of sales, had no cost in Product_Lookup; the test failed, the product team added the costs, and those lines cost £1,529.
- Net sales: £148,620 − £3,410 − £1,260 = £143,950
- Cost of sales: £99,870 + £1,529 = £101,399
- Gross margin: £143,950 − £101,399 = £42,551, a margin of 42,551 ÷ 143,950 = 29.6%
The reconciliation.
| Cause | Net sales gap | Margin gap |
|---|---|---|
| Credit note posted after the export | +£1,260 | +£1,260 |
| New SKUs with cost counted as zero | £0 | +£1,529 |
| Rebate counted twice | −£950 | −£950 |
| Total gap (Excel − pipeline) | +£310 | +£1,839 |
Check: £144,260 − £143,950 = £310, and £44,390 − £42,551 = £1,839. Nothing is left unexplained, so week 44 passes. Against a £150,000 budget, the workbook showed sales £5,740 short; the pipeline shows £6,050 short. The margin the board would have seen was 1.2 points higher than the accounts support, and no single error was large enough to look wrong on the page.
Step 4: decide what stays in Excel
Not every tab should leave Excel. The aim is that Excel holds only what people type or read, never what a system already knows.
Keep as validated inputs. Budgets and adjustments have no other home, so they stay in Excel, moved into small dedicated files with a fixed layout that the pipeline reads. Add data validation: categories from a list, weeks as whole numbers, a reason and approver required on every adjustment. Microsoft's notes on data validation say its messages do not appear when data is copied or filled in, and that existing invalid entries are not flagged automatically. So the pipeline checks the same rules again when it reads the file.
Keep as an output. If the finance team wants the weekly report as a spreadsheet so they can filter and annotate it, give them one. The difference is that the file is produced from tested models and replaced each week, not edited forward.
Move to the pipeline. Pasted exports, and any lookup that a system already owns, go. Where nobody owns a mapping yet, keep it as a validated input until someone does, and make the test list unmapped rows rather than drop them.
How to automate it with IVP.ai
The IVP.ai Data Layer connects to the systems behind your workbook (anything with a REST API, any SQL database, and the Excel files you decide to keep as inputs), loads them on a schedule into a governed warehouse, and holds the joins, formulas and tests above as shared definitions. The weekly report then runs from those models, and can still be delivered as an Excel file if that is how people like to read it.
Deskless by IVP.ai can sit on top as a report or agent: checking each week's tests, holding the report back when a SKU has no cost or an adjustment repeats a credit, and sending the exception to the person who owns it. By default it flags and waits for a person; it only acts on its own where a business sets it up to. Other connections are listed on the integrations hub.
To try this on your own workbook, apply for the free 48-hour pilot. We connect up to three sources, for example your accounts system, product master and budget file, clean the data and set one report or agent running on real data within 48 hours of read-only access. You then have 14 days of access to choose a plan or walk away.