The firm opens soon. Guides and calculators are already free to use —get notified when we open
Excel

Excel: using a pivot table to summarise a general ledger in three minutes

Create a pivot table from a general ledger: fields, grouping by quarter, filters, refreshing and calculated fields. An illustrated accounting tutorial.

Published 9 min readLevel: BeginnerEl Arabi Aich

In brief
  • A pivot table summarises a long list of rows into a cross-tabulated summary table, without writing a single formula.
  • It is built by dragging fields into four areas: Rows, Columns, Values and Filters.
  • Dates can be grouped by month, quarter or year; amounts are totalled by account, third party or journal.
  • After modifying the source data, you must refresh the pivot table (Alt+F5); the source should be formatted as an Excel table so new rows are picked up.

When accounting entries run into the thousands, formulas give way to a faster tool: the pivot table. It turns a raw list into a structured summary in a few clicks, and can be reshaped simply by dragging fields. Here is a guide for accounting use, highlighting the key screens.

What a pivot table does

A pivot table groups the rows of a data source by one or more categories (account, quarter, third party, journal) and calculates a value (sum, count, average). It replaces dozens of SUMIFS formulas and updates in a single click.

Step 1: prepare the source data

The source must be a clean list: one header row, one accounting entry per row, no total rows, no merged cells and no blank columns. Typical columns: Date, Journal, Account, Description, Third Party, Debit, Credit.

Tip: select any cell in the list and press Ctrl+T to convert it into an Excel table. Rows added later will be automatically included in the pivot table.

Step 2: insert the pivot table

  1. Click anywhere inside the list.
  2. Go to the Insert tab > PivotTable.
  3. Select “New Worksheet” > OK.
  4. The PivotTable Fields pane opens on the right with four areas: Filters, Columns, Rows, Values.

Step 3: build the table

To obtain expenses by account and by quarter:

  1. Drag Account (or a field combining account number and title) into Rows.
  2. Drag Date into Columns: Excel often creates Months or Quarters fields automatically.
  3. Drag Debit into Values (“Sum of Debit”).
  4. Drag Journal into Filters so you can isolate the purchases journal.

Pivot table showing expenses by account in rows and by quarter in columns with a grand total Figure 1: marker 1 shows the Rows area (accounts), marker 2 the Columns area (quarters), and marker 3 a value in the Values area. (Note: the illustration shows the French-language Excel interface such as Lignes, Colonnes, Valeurs and French labels, whereas the menu paths and formulas in the text use English Excel syntax.)

Result: each expense appears by quarter, with row and column totals. The grand total of MAD 845,400 can be compared directly against the general ledger total as a control check.

Step 4: group dates

If the columns display individual daily dates: right-click a date > Group, and select Quarters (and Years if the period spans more than 12 months). Excel groups them into Q1, Q2, Q3 and Q4.

Step 5: sort, filter and format

  • Sort: right-click > Sort > Sort Largest to Smallest (rank expenses by amount).
  • Filter: use the field in the Filters area, or the filter drop-down arrow on row labels.
  • Slicers: PivotTable Analyze > Insert Slicer (visual filter buttons).
  • Number format: right-click a value > Number Format: thousands separator, no decimal places.
  • Style: PivotTable Design tab (banded rows, subtotals and grand totals).

Step 6: advanced calculations

Need Method
Each account’s share of the total Value Field Settings > Show Values As > % of Column Total
Quarter-on-quarter change Show Values As > Difference From > Q1 (or % Difference From)
Balance (debit − credit) Add a calculated field: PivotTable Analyze > Fields, Items, & Sets > Calculated Field > =Debit-Credit
Analysis by third party Replace Account with Third Party in Rows
Drill-down on a figure Double-click the value: Excel opens the underlying source rows in a new worksheet

Double-clicking is particularly useful for substantiating a total to an auditor.

A worked step-by-step exercise

Eight rows of operating expenses (general ledger extract, in MAD):

Date Account Amount
12/01 6136 12,000
25/01 6131 8,000
14/02 6136 9,500
02/03 6144 15,000
15/04 6136 11,000
20/05 6144 22,000
08/06 6131 8,000
30/06 6144 7,500

Building the pivot table. Insert > PivotTable; place Account in Rows, Date in Columns (then right-click a date > Group > Quarters), and Amount in Values (Sum). Expected result:

Account 1st Quarter 2nd Quarter Total
6131 Rentals 8,000 8,000 16,000
6136 Professional fees 21,500 11,000 32,500
6144 Advertising 15,000 29,500 44,500
Grand Total 44,500 48,500 93,000

Displaying percentages. Right-click a value > Show Values As > % of Grand Total: 6131 = 17.2%, 6136 = 34.9%, 6144 = 47.8%. Advertising accounts for nearly half of the period’s expenses and grew by 97% from one quarter to the next (15,000 → 29,500): it is the first item to review.

Pulling a figure into a formula. To carry the total for professional fees over to another sheet without copying and pasting, the GETPIVOTDATA function reads a pivot table cell reliably, even if the table layout changes:

=GETPIVOTDATA("Amount",$A$3,"Account","6136")

(the second argument points to a cell inside the pivot table; the result is 32,500).

Filtering in one click. PivotTable Analyze > Insert Slicer: an “Account” or “Journal” slicer filters the table on demand, which is ideal during a review meeting.

Checking that the pivot table is accurate

  1. The grand total of the pivot table equals the sum of the source column (here 93,000).
  2. No blank cells in the source columns: a missing date creates a “(blank)” row.
  3. Amounts are numbers (right-aligned): an amount stored as text is not summed.
  4. Refresh after any change to the source data (PivotTable Analyze > Refresh, or Alt + F5).
  5. When new rows are added, use an Excel table (Ctrl + T) as the source so the pivot table picks up the new rows on refresh.

Five useful analyses from the same general ledger

A well-structured pivot table answers many questions without formulas. With a general ledger converted into an Excel table (columns: Date, Account, Title, Journal, Description, Debit, Credit), here are five analyses.

Question Rows Columns Values Note
What is the trial balance by account? Account, Title Sum of Debit, Sum of Credit Check: total debit = total credit
How do expenses trend month by month? Account (filtered on class 6) Date grouped by month Sum of Debit − Credit Calculated column “Balance” in the source
Which expenses increased the most? Account Financial Year Sum of Balance; show % change “Show Values As” > “% Difference From”
Which suppliers account for the largest share? Third Party (4411 accounts) Sum of Credit; ranked Sort descending, “Top 10” filter
What share does each expense represent? Account Sum of Balance as “% of Grand Total” Compare against the revenue structure

Tip: add a column Balance = Debit − Credit and a column Class = LEFT(Account,1) to the source table. They allow you to filter by account class and compute balances without a calculated field.

Grouping by month, quarter and financial year

On a date field, right-click inside the table, select Group, and choose Months, Quarters and Years. A general ledger covering two years then gives a breakdown by financial year, quarter and month in seconds. For an off-calendar financial year (closing on 30 June), build a “Financial Year” column in the source using the formula =IF(MONTH([@Date])>6,YEAR([@Date])+1,YEAR([@Date])) and use it as a grouping field.

A calculated field: profit margin

In a pivot table built on sales and costs, add a calculated field: PivotTable Analyze > Fields, Items, & Sets > Calculated Field. Name: Margin, formula: =Sales - Costs. A second field Margin Rate: =(Sales - Costs) / Sales. The result is calculated at the aggregated level (by product family, by customer) rather than row by row, which is mathematically correct for group margins. Note: a calculated field cannot use lookup functions, conditions across other rows, or cell references.

Slicers for an interactive dashboard

Slicers are visual filter buttons. On a revenue pivot table, add slicers for Product Family, Sales Rep and Financial Year. Link them to multiple tables (right-click the slicer > Report Connections) so a single click updates all tables and charts on the sheet. A Timeline lets you filter by date range by dragging a slider. This layout works well for a monthly management dashboard.

Verifying a pivot table with three checks

  1. Pivot table grand total = trial balance total: reconcile total debits and total credits against the source (=SUM(Source[Debit])).
  2. Row count: compare the pivot table count (values summarised by “Count”) against the number of rows in the source.
  3. Spot check: pick an account and verify its balance using SUMIFS.

If a check fails, the most common cause is a source range that excludes newly added rows: use an Excel table (Ctrl+T) so the pivot table updates when you click Refresh All.

Common errors and fixes

Symptom Cause Fix
Amounts appear as “Count” Column contains text (blank cells, amounts imported as text) Convert to numbers, remove spaces
Dates cannot be grouped Dates stored as text Convert with DATEVALUE or Data > Text to Columns
New rows missing Fixed range Format the source as an Excel table
“(blank)” rows Blank cells in the source Fill in or filter out
Wrong totals after editing a source cell Pivot table not refreshed Refresh All (Alt+F5)
Pivot table loses formatting on refresh Auto-fit widths Uncheck “Autofit column widths on update”

Refreshing

After any data change: right-click the pivot table > Refresh, or press Alt+F5. To refresh automatically when opening the file: PivotTable Analyze > Options > Data > “Refresh data when opening the file”.

Common pitfalls

  1. Blank cells or text in an amount column: Excel defaults to “Count of” instead of summing.
  2. Dates stored as text: grouping is disabled.
  3. Missing header in a column: error message when creating the pivot table.
  4. Fixed source range: new entries do not appear; convert the source to an Excel table.
  5. Wrong total due to duplicate entries: audit the source before analysing.
  6. Pivot table pasted as values: it loses its dynamic link and quickly becomes outdated.

When to prefer formulas instead

Pivot tables are ideal for exploration and ad-hoc summaries. For fixed-layout reporting (such as a monthly dashboard sent out to stakeholders), formulas (SUMIFS) or Power Query are a better fit: full control over layout and no manual refresh required.

Special cases and edge situations

The source contains thousands of rows and the workbook is slow. Use the Data Model (Power Pivot) instead of a standard range, or pre-process the data in Power Query to drop unnecessary columns.

The pivot table does not recognise newly added rows. Convert the source into an Excel table and refresh; or update the pivot table’s data source range to cover all rows.

Months appear out of order. The dates are stored as text: convert them into true Excel dates, then group by month.

You want to display percentages of the total. Right-click the value, select Show Values As, then choose % of Grand Total, % of Column Total or % Difference From.

The pivot table needs to be shared without the underlying data. Go to PivotTable Options > Data: uncheck “Save source data with file”; the recipient will be able to read the summary table without drilling down into the source rows.

Key takeaways

A pivot table built on an Excel table source analyses a general ledger in a few clicks. Checks are essential: pivot table total matching the source total, row count verification and a spot check on one account. Slicers and timelines turn it into an interactive dashboard.

Frequently asked questions

Why is my pivot table not updating?

A pivot table does not recalculate automatically: right-click and select Refresh, or go to Data > Refresh All (Alt+F5). To ensure it detects newly added rows, format the source as an Excel table (Ctrl+T) or use a dynamic range.

Dates appear day by day—how do I group them?

Right-click a date in the pivot table > Group, then select Months, Quarters and Years. If the Group button is greyed out, some dates are stored as text or there are blank cells in the source column.

What does “Count of” mean instead of “Sum of”?

If the column contains blank cells or text, Excel counts the rows instead of summing them. Convert the column to numbers, then click the field in Values > Value Field Settings > Sum.

Can I display percentages?

Yes: Value Field Settings > Show Values As > % of Grand Total (or % of Column Total, or % of Row Total). This is useful for viewing the expense breakdown or each customer’s share.

El Arabi Aich

Article written from the official texts and the firm’s engagement practice. It shows its publication date and, where applicable, its last review.

Related articles

A question about your situation?

Tell us about your project: we reply within 48 business hours with a draft engagement letter.