Chapter 6: Descriptive and Diagnostic Analytics in Excel

Accounting Analytics: An Integrated Approach

In this chapter

Part II of V: Accounting Analytics with Excel

Chapter 3 of 5 in this Part

  • 6.1 Descriptive and Diagnostic Analytics in Accounting
  • 6.2 Summary Statistics
  • 6.3 Conditional Aggregation and Control Totals
  • 6.4 Charting Descriptive Results
  • Guided Tutorial 6.1
  • 6.6 PivotTables
  • Guided Tutorial 6.2
  • 6.8 From the Ledger to the Financial Statements
  • 6.9 From Description to Diagnosis
  • Guided Tutorial 6.3
  • 6.11 Interpreting and Communicating Results
  • 6.12 Looking Ahead

Learning objectives

  1. Describe a numeric column, or part of it, with statistical functions such as AVERAGE, MEDIAN, STDEV.S, MIN, MAX, and PERCENTILE.INC, and show the shape of its distribution with a histogram.
  2. Calculate conditional totals, counts, and averages with SUMIFS, COUNTIFS, AVERAGEIFS, MINIFS, and MAXIFS, and test with a control total whether a summary accounts for the whole population it describes.
  3. Build PivotTables and PivotCharts from an Excel Table that summarize data across two or more dimensions, and choose a chart that fits the question.

Learning objectives (continued)

  1. Create calculated fields for margins and ratios, and explain why a calculated field works on totals rather than on individual rows.
  2. Explain a change between two periods by drilling down, comparing, and decomposing it into price, volume, mix, and cost effects, and communicate the finding.
  3. Build a pre-closing trial balance and a common-size income statement from the general ledger.

Three requests for the management meeting

  • InvoiceLines is ready, and the controller wants three things for the quarterly meeting
  • A profile of what Charles River billed in the year, with a total that ties
  • Revenue and gross margin by product line and quarter, and the year’s income statement
  • Most important: why did the Furniture margin fall from the third quarter to the fourth?

6.1 Descriptive and Diagnostic Analytics in Accounting

Describe what happened, then explain why

  • Descriptive: totals, averages, distributions and comparisons of the past
  • Statements, budget reports, ageing schedules and KPIs are all descriptive
  • Diagnostic: drill into a summary, compare it with an expectation, decompose a change
  • The tools: statistics, conditional totals, PivotTables, and a margin bridge

6.2 Summary Statistics

The mean and the median tell different stories

  • AVERAGE is pulled up by a few very large values
  • MEDIAN is the middle value, whatever the extremes
  • A mean well above the median suggests a right skew, which a histogram shows
  • The average invoice line is about half again as large as the median line

Spread and extremes are also data checks

  • STDEV.S treats the values as a sample; STDEV.P as the whole population
  • A standard deviation is easiest to read relative to the mean
  • MIN and MAX catch values that should not exist before any statistic is trusted
  • PERCENTILE.INC: the top tenth of the lines carries nearly a third of revenue

Statistics for part of a table need FILTER

  • AVERAGEIFS, MINIFS and MAXIFS accept criteria
  • MEDIAN, STDEV.S and PERCENTILE.INC do not, and there is no MEDIANIFS
  • =MEDIAN(FILTER(InvoiceLines[LineTotal],InvoiceLines[FiscalYear]=ReportYear))
  • If no row meets the condition, FILTER returns #CALC!

Watch out: statistics can hide the data

  • Anscombe built four data sets with the same means and fitted line that look nothing alike
  • A statistic of a mixed population may describe none of its members
  • The average line falls between small accessories and large design services
  • Sort, filter or chart the data first, and summarize groups that differ separately

6.3 Conditional Aggregation and Control Totals

Conditional totals fail silently; a control total catches it

  • SUMIFS, COUNTIFS, AVERAGEIFS, MINIFS and MAXIFS share one pattern of criteria
  • Keep criteria in cells: a column of groups, a named ReportYear
  • A misspelled criterion returns zero (AVERAGEIFS #DIV/0!); a typed list can omit a category
  • A control total of the whole population must equal the sum of the parts

Check your understanding

What does each situation call for?

  1. Reporting the size of a typical invoice line
  2. The median of one year’s lines
  3. A SUMIFS by item group that returns zero for one group
  4. Testing that a summary by group covers the whole population

Each situation has its tool

  1. MEDIAN, because the lines are skewed to the right
  2. MEDIAN of FILTER, since there is no MEDIANIFS
  3. Check the criterion’s spelling before trusting the zero
  4. A control total whose difference from the parts is zero

6.4 Charting Descriptive Results

Choose the chart that answers the question

Table 6.1 · Charts for common descriptive questions

Question Chart Accounting example
How do categories compare? Column or bar chart, sorted by value Revenue by product line
How does a measure change over time? Line chart Monthly revenue or margin
What does a total consist of? Stacked column chart Revenue by segment within each quarter
How are values distributed? Histogram The number of invoice lines in each range of amounts
How do two measures relate? Scatter chart Commission expense against revenue by month
How did one total become another? Waterfall chart The change in margin from one quarter to the next

A histogram shows shape; a PivotChart follows its table

  • A histogram counts the values in bins of equal width
  • Insert Statistic Chart draws one from every value in a range
  • For one year only, count each bin with COUNTIFS and chart it without gaps
  • A PivotChart shows its PivotTable’s layout, filters and slicers, and refreshes with it

A chart should tell the truth

  • The value axis of a bar or column chart starts at zero
  • When a waterfall or line chart needs a truncated axis, say so
  • Sort bars by value unless the categories have a natural order
  • Label what the chart shows and means; drop decoration; never rely on color alone

Guided Tutorial 6.1: Profiling Fiscal 2026 and Checking the Total

Steps 1 to 5: parameters and measures

  1. Add the report year as a parameter
  2. Set up the Profile worksheet
  3. Calculate the measures that accept criteria
  4. Calculate the measures that need FILTER
  5. Look at the extremes

Steps 6 to 10: groups, bins and chart

  1. Total the product lines
  2. Find and add the missing group
  3. Count the lines in $1,000 bins
  4. Chart the bins as a histogram
  5. Document the profile

The control total found a missing group

A mock of the Profile worksheet. Rows 1 through 9 show the fiscal year, 2026, and the count, total, average, median, standard deviation, smallest and largest line, and 90th percentile of the year's invoice line totals, with the median cell selected and its MEDIAN and FILTER formula in the formula bar. Rows 11 through 18 show the lines, revenue, and average line of each item group, with the Services row added below Furniture, Lighting, Textiles, and Accessories, a total of the groups, and a difference from the control total of zero. The Services row and the difference row are outlined.
Figure 6.1 · A Profile of Fiscal 2026 Invoice Lines with a Control Total

The line totals are skewed to the right

A mock of columns F and G of the Profile worksheet and a chart beside them. The table lists the lower bound of each 1,000-dollar bin, from 0 to 15,000, with the number of fiscal 2026 invoice lines in each and a total that equals the year's line count; the formula bar shows the COUNTIFS formula of the first bin. The chart is a histogram of the counts: the first bins are the tallest, and the bars generally fall toward the right into a long, thin tail of large lines, ending in an open-ended last bin, labeled 15k+, for lines of 15,000 dollars or more.
Figure 6.2 · The Distribution of Fiscal 2026 Line Totals

Checkpoint

Check that:

  • the average line is well above the median line, and you can explain why;
  • the Profile worksheet lists five item groups, and both differences from the control total are zero;
  • the bins of the histogram add up to the year’s line count, and the chart shows a right skew;
  • changing ReportYear on the Parameters worksheet to 2025 updates every number on the Profile worksheet, and changing it back to 2026 restores them.

6.6 PivotTables

Four areas build a PivotTable

A diagram of the PivotTable Fields pane next to the PivotTable it produces from the InvoiceLines Table. In the pane, the LineTotal, ItemGroup, FiscalYear, and Period fields are checked, and the four areas hold FiscalYear in Filters, Period in Columns, ItemGroup in Rows, and Sum of LineTotal in Values, each marked with a number from 1 to 4. The PivotTable shows the FiscalYear filter set to 2026, the four quarters of 2026 and a Grand Total across the top, the five item groups and a Grand Total down the side, and the sum of the line totals in every cell. The same numbers mark the parts of the PivotTable that each area produces, and a legend explains them.
Figure 6.3 · How the PivotTable Fields Areas Build a PivotTable

Summarize, group and refresh

  • Value Field Settings changes Sum to Count, Average or others, and names the field
  • Counting an ID counts rows; Σ Values in Rows stacks several measures
  • Use the period columns of InvoiceLines rather than calendar date grouping
  • A PivotTable summarizes a copy, so refresh it; GETPIVOTDATA references it safely

A calculated field works on totals

  • Its formula runs on the sums of the fields behind each cell, not on rows (Microsoft)
  • So a margin percentage is total margin over total revenue: a weighted margin
  • The cost must already be extended, quantity times standard cost, in the source
  • Never multiply fields in a calculated field; multiply row by row in the source

Show Values As displays the same values differently

Table 6.2 · Show Values As options for accounting summaries

Show Values As option What it displays Accounting use
% of Grand Total Each value as a share of the grand total Each segment and product line’s share of the year’s revenue
% of Column Total Each value as a share of its column’s total The product mix within each quarter
% of Row Total Each value as a share of its row’s total How a product line’s revenue is spread across the quarters
Difference From The difference from a base item, such as the previous period The dollar change from one quarter to the next
% Difference From The percentage difference from a base item Growth or decline from the previous quarter or year
Running Total In A running total across the base field Year-to-date revenue by month

Watch out: a PivotTable sums every source row

  • In the Part I case, a ledger summary by quarter showed nonsense in the fourth quarter
  • The year-end close debits sales revenue and credits cost of goods sold on the last day
  • Filter out the closing entries, or filter the source document types you need
  • Know which rows a source contains before you trust its totals

Check your understanding

Calculated field, or a column in the source?

  1. A margin percentage for every cell
  2. Revenue as quantity times unit price
  3. The average price per unit sold
  4. The extended standard cost of each line

Ratios of totals in the PivotTable; products in the source

  1. Calculated field: total margin over total revenue
  2. Source column: multiplying totals would be wrong
  3. Calculated field: total revenue over total quantity
  4. Source column: quantity times standard cost, row by row

Guided Tutorial 6.2: Revenue and Margin by Product Line and Quarter

Build the revenue and margin PivotTable in eight steps

  1. Add the extended standard cost to the query
  2. Create the PivotTable
  3. Add the margin as a calculated field
  4. Read the margins
  5. Read the revenue as shares and as changes
  6. Compare the customer segments with the previous year
  7. Chart the margins with a PivotChart
  8. Refresh and document

Furniture fell most while the other lines barely moved

A mock of the RevenuePivot worksheet. The PivotTable is filtered to fiscal year 2026, with the four quarters and a Grand Total across the top. Down the side, each of the five item groups shows two rows, Sum of LineTotal and Sum of MarginPct, followed by the totals of both measures. The Furniture margin row is outlined, showing a lower margin in the fourth quarter than in the third, and the Services margin row is outlined, showing 100 percent in every quarter.
Figure 6.6 · Revenue and Margin at Standard Cost by Item Group and Quarter

The Furniture margin fell in the fourth quarter

Detail of the RevenuePivot worksheet, filtered to fiscal 2026, with the four quarters and a Grand Total across the top. The revenue and margin rows of Accessories, Furniture, and Lighting are shown. The outlined Furniture margin row is lower in the fourth quarter than in the third, while the Accessories and Lighting margins barely change.
Figure 6.6 · Revenue and Margin at Standard Cost by Item Group and Quarter (detail)

Checkpoint

Check that:

  • the grand total of the RevenuePivot PivotTable equals the control total on the Profile worksheet, and each group’s Grand Total equals its revenue there;
  • the Furniture margin falls from 2026-Q3 to 2026-Q4, while the margins of the other product lines change very little;
  • you can explain why Services shows a margin of 100 percent;
  • the SegmentPivot PivotTable shows each segment’s revenue in 2025 and 2026 and its change from the previous year;
  • the MarginChart shows the Furniture margin below the others and falling in the fourth quarter.

6.8 From the Ledger to the Financial Statements

A trial balance groups the ledger by account

  • Group By in Power Query sums debits and credits by account before loading
  • A merge with the Account Table adds each account’s number, name and subtype
  • Only rows posted on or before the reporting date belong in it
  • A pre-closing balance leaves out the year’s own closes, so it shows the year’s results

Debit and credit balances agree

Detail of the TrialBalance worksheet. The first rows list cash, receivables, finished goods, materials, work in process, and prepaid expenses with their debit balances, and a Total Row closes the table. The outlined totals of the debit and credit balance columns are equal.
Figure 6.7 · From the Trial Balance to the Income Statement (detail)

A common-size statement ties to the closing entry

Detail of the IncomeStatement worksheet. The formula bar shows the SUMIFS formula, with a negative sign, for operating revenue in cell B2. The statement runs from operating revenue through sales returns, net revenue, cost of goods sold, gross margin, operating expenses, and operating income to net income, each line with its percentage of net revenue, and the net income row is outlined.
Figure 6.7 · From the Trial Balance to the Income Statement (detail)

Watch out: an extract is only as complete as its dates

  • The ledger already holds supplier payments of the next fiscal year
  • Without a date filter, a trial balance would mix two years
  • Filter by posting date before you group
  • Equal debits and credits, and the closing entry, test totals, not completeness

6.9 From Description to Diagnosis

Diagnosis drills down, compares and decomposes

  • Drill down: double-click a value for its rows, or add a finer field to Rows
  • Compare: the previous period, the same period last year, a budget or peers
  • Decompose: split the change into parts that add up exactly to it
  • Each part can then be investigated on its own

A bridge splits the change into effects that add up

Table 6.3 · The effects of a margin bridge

Effect What it measures Calculation, Q3 to Q4
Volume The change in units, at the third quarter’s margin per unit (U4-U3)*M3
Mix The change in list margin per unit, because different items were sold U4*(LM4-LM3)
Price: price lists The change in price-list reductions per unit -U4*(K4-K3)
Price: promotions The change in promotional discounts per unit -U4*(D4-D3)
Cost The change in each item’s standard cost Zero when no standard cost changes

Mix, cost and the level of the bridge

  • List prices and standard costs do not change, so the list margin moves only with mix
  • At standard cost, the cost effect is zero by construction
  • Actual cost differences sit in the ledger’s variance accounts
  • Calculated by product type, the same change divides differently; state the level

Check your understanding

Which effect of the bridge does each change fall into?

  1. More units sold at the same margin per unit
  2. Sales shift toward items with a lower list margin
  3. A promotional discount on the lines
  4. A component becomes more expensive to buy

Each change has its effect

  1. Volume
  2. Mix
  3. Price: promotions
  4. Cost: zero at standard, so look in the variance accounts

Guided Tutorial 6.3: Explaining the Furniture Margin

Explain the margin in eight steps

  1. Add the list amount and the discount to the query
  2. Build the driver PivotTable
  3. Add the per-unit measures
  4. Collect the driver totals
  5. Calculate the per-unit measures and the bridge
  6. Chart the bridge as a waterfall
  7. Drill into the discounts
  8. Record the finding

Promotions are the largest component of the decline

A waterfall chart of the Furniture margin at standard cost. It starts with a total bar for the 2026-Q3 margin, followed by a small increase for volume, small changes for mix and price lists, a large decrease for promotions, and no change for cost, and it ends with a lower total bar for the 2026-Q4 margin. Each bar is labeled with its dollar amount and sign, and a legend distinguishes totals, increases, decreases, and no effect. The vertical axis starts at 1.6 million dollars.
Figure 6.9 · The Furniture Margin Bridge from the Third to the Fourth Quarter

One promotion supplies most of the discounts

A mock of the Discounts worksheet. A PivotTable filtered to Furniture shows, for 2026-Q3 and 2026-Q4, the count of invoice lines and the sum of discounts for lines with no promotion and for promotions 7, 8, and 9. The promotion 8 row is outlined across both quarters, with far more lines and discount in the fourth quarter, and the promotion 9 cells of the fourth quarter are outlined. Below, rows of the PromotionProgram Table give the code, name, scope, and discount rate of promotions 7, 8, and 9.
Figure 6.10 · Furniture Discounts by Promotion and Quarter

Checkpoint

Check that:

  • the Check cell, B23 on the Bridge worksheet, is zero to the cent, and C23 reads PASS;
  • the promotions effect is larger than the decline in margin, and the volume, mix, and price-list effects are small by comparison;
  • the margin before discounts does not fall from the third quarter to the fourth;
  • promotion 8 accounts for most of the Furniture discounts in both quarters, and promotion 9 adds to them in the fourth.

6.11 Interpreting and Communicating Results

A finding says what, how you know, and what next

  • What: the Furniture margin fell by about a point and a half
  • Why: promotional discounts more than doubled; the rest barely moved
  • How you know: the bridge ties to the change, and the drill names the promotion
  • A PivotTable is a data product; the sentence is the finding

Expect first; claim only what the evidence shows

  • Auditors compare recorded amounts with expectations from plausible relationships
  • Decide in advance how large a difference is acceptable (PCAOB)
  • The bridge shows how much the discounts cost, not whether the promotion was wise
  • Match precision to the reader: cents in a workpaper, thousands in a memo

6.12 Looking Ahead

Back to the controller’s question

  • The Furniture margin fell because promotional discounts more than doubled
  • Most came from the Furniture Seasonal Promotion, invoiced well into the fourth quarter
  • Volume, mix, list prices and standard costs explain almost none of it
  • Next, Chapter 7 turns from what happened to what could happen

Summary

  • The median describes a typical line; the mean and the large values carry the total
  • Conditional totals need a control total, because they fail silently
  • PivotTables summarize across dimensions; calculated fields work on totals
  • A pre-closing trial balance gives a common-size statement that ties to the close
  • A bridge decomposes a change into effects that add up exactly

Key terms

Calculated field · Common-size statement · Conditional aggregation · Control total · Cost effect · Cross-tabulation · Drill-down · GETPIVOTDATA · Group By · Histogram · Margin bridge · Mean · Median · Mix effect · Pivot cache · PivotTable · Pre-closing trial balance · Price effect · Show Values As · Skewed distribution · Standard deviation · Substantive analytical procedure · Value field · Volume effect · Waterfall chart

Practice and next steps

  • Financial Accounting
    • Exercise 6.1: From the Ledger to the Income Statement
    • Exercise 6.2: Disaggregating Revenue by Segment and Product Line
  • Managerial Accounting
    • Exercise 6.3: Product-Line Profitability at Standard Cost
    • Exercise 6.4: The Margin Bridge by Product Type
  • Auditing
    • Exercise 6.5: A Substantive Analytical Procedure on Quarterly Revenue
    • Exercise 6.6: A Descriptive Profile of the Revenue Population

Next: Chapter 7: Forecasting, Budgeting, and What-If Analysis in Excel

About these slides

These slides accompany Accounting Analytics: An Integrated Approach, licensed under CC BY-SA 4.0. Every figure and table comes from the chapter:

https://aa.accountinganalyticshub.com/chapters/06-descriptive-analytics/chapter.html