Worked exampleExcel
Pivot tables for month-end analysis
A pivot table turns a month's ledger lines into a cost-centre view in minutes, and here its drill-down finds EGP 87,500 of September fuel counted twice in October.
- Written by Mahmoud Sabry
- Published
- Last updated
- Reading time 5 min read
- Checks Check lines recalculated by script Editorial policy
The problem: logistics costs jump by 92,500
An accountant at a distribution company in Egypt closes October. The ledger export for September and October has 98 expense lines. The finance manager wants one answer by Sunday: what moved, and why?
Reading 98 lines will not answer that. A pivot table will, in four steps.
Step 1: a clean export for the pivot table
A pivot table is only as good as its source. Each ledger line must be one row, with one header row, no blank rows and no subtotals. Keep the columns the analysis needs: month, cost centre, account, description and amount, with the month as a number. Format the range as a table, so new lines are included when you refresh.
Step 2: cost centres by month, and the change
Put cost centre in rows, month in columns and the sum of amount in values. Then add the amount a second time and show it as the difference from the previous month.
Table 1
Logistics explains 92,500 of the 97,500 rise in October costs
Expenses by cost centre, September and October, EGP, from the pivot table
| Cost centre | September | October | Change |
|---|---|---|---|
| Sales | 405,000 | 412,000 | 7,000 |
| Administration | 270,000 | 268,000 | (2,000) |
| Logistics | 262,500 | 355,000 | 92,500 |
| Total | 937,500 | 1,035,000 | 97,500 |
Source: Illustrative calculation from hypothetical data.
The change column ranks the work. Logistics carries almost all of the rise, so it is the first number to explain.
Step 3: drill down into the largest change
Double-click the logistics figure for October. The spreadsheet opens a new sheet with every ledger line behind that number. Here the other logistics costs are 175,000 in both months, so the whole rise sits in fuel.
Exhibit 1
Without the reversal, October fuel shows 180,000 instead of 92,500
October fuel lines from the drill-down, before and after the correcting entry, EGP
Before
| A | B | |
|---|---|---|
| 1 | Line | Amount |
| 2 | Invoice for September fuel | 87,500 |
| 3 | October fuel accrual | 92,500 |
| 4 | Total | 180,000 |
After
| A | B | |
|---|---|---|
| 1 | Line | Amount |
| 2 | Reversal of September accrual | (87,500) |
| 3 | Invoice for September fuel | 87,500 |
| 4 | October fuel accrual | 92,500 |
| 5 | Total | 92,500 |
Source: Illustrative example.
View data table
| Before 2 | Invoice for September fuel | 87,500 |
|---|---|
| Before 3 | October fuel accrual | 92,500 |
| Before 4 | Total | 180,000 |
| After 2 | Reversal of September accrual | (87,500) |
| After 3 | Invoice for September fuel | 87,500 |
| After 4 | October fuel accrual | 92,500 |
| After 5 | Total | 92,500 |
The lines tell the story. At the end of September, the invoice for September fuel had not arrived, so the accountant accrued 87,500: a debit to fuel expense and a credit to accrued expenses.
In October the invoice arrived and was posted as a debit to fuel expense. The September accrual should have been reversed on the first day of October, with a credit to fuel expense. It was not, so September's fuel is in the books twice.
Step 4: correct, refresh and tie back
Post the missing reversal, a credit of 87,500 to fuel expense and a debit to accrued expenses, then refresh the pivot table. Logistics falls to 355,000 - 87,500 = 267,500, and its real change is 267,500 - 262,500 = 5,000.
Then tie the pivot table back to the source. Its grand total for October must equal the October total in the ledger export, for example =SUMIFS(E2:E99, A2:A99, 10), where column A holds the month and column E the amount, as laid out in Step 1.
If they differ, a filter is hiding lines or the source range is too short.
Common errors
- Explaining a change from the summary: the story is guessed, not found. Correction: drill down and read the lines.
- A source with subtotals or blank rows: the pivot table counts some amounts twice or misses others. Correction: one row per ledger line, nothing else.
- Forgetting to refresh after a correction: the pivot table still shows the old number. Correction: refresh, then tie the grand total back to the ledger.
How to check your work
- Confirm the October total:
412000 + 268000 + 355000 = 1035000. - Confirm the double count:
87500 + 92500 = 180000booked, against 92,500 correct. - Confirm the real logistics change after the fix:
267500 - 262500 = 5000. - Confirm the pivot grand total equals the ledger export for the month.
Limits of the method
A pivot table shows what was posted, not what should have been: it found the double count only because the change was large. Small errors hide inside small changes, so the month-end checklist still needs its reversals and accrual reviews.
Frequently asked questions
Should the pivot table sit in the same file as the ledger export?
Yes, on its own sheet, reading the table, so a refresh picks up every new line.
Why keep the month as a number?
Numbers sort in the right order and can be compared in formulas; month names can sort alphabetically.
Can I format the pivot table for the management report?
Use it to find and explain changes; build the report from formulas that reference it, so the layout stays fixed.
Terms in this article
| English | Arabic | Meaning |
|---|---|---|
| Pivot table | الجدول المحوري | A spreadsheet summary that groups and totals rows by the fields you choose |
| Drill down | التعمق في التفاصيل | Opening the source lines behind one number in a summary |
| Accrual reversal | عكس الاستحقاق | The entry that cancels last month's accrual when the real invoice is posted |
Related lessons
- TECH-A4Pivot tables for finance
- TECH-A3From messy export to clean table
- TECH-A2Formulas finance actually uses
Read next
Sources and notes
Figures and companies in the examples are illustrative and hypothetical, and do not refer to any real organisation.
Amounts are in EGP for a hypothetical company.
Educational content, not financial, tax or investment advice. Check the standards and rules in force before applying anything.
Share this article
A pivot table at month-end: summarise, compare, drill into the biggest change. Here it found EGP 87,500 counted twice: