Computer ScienceChapter 47 min read

Excel from Basics to Advanced — PivotTables and Charts

O
OIYO EditorialContributor
4/5

Why Are PivotTables So Powerful?

PivotTables let you aggregate and analyze thousands of rows of data in seconds, without writing a single formula. They’re the most widely used analysis tool in real-world work — for sales performance analysis, cost aggregation by department, month-over-month revenue trends, and more.


Creating a PivotTable

Data prerequisites

Before you build a PivotTable, your data needs to meet the following conditions.

ConditionDescription
First row is a headerColumn titles must be clear
No blank rows or columnsNo gaps in the middle of the data
No merged cellsMerged cells can’t be pivoted
Consistent data typesDate columns should all be dates; number columns all numbers

Steps to create one

  1. Click any cell within your data
  2. Insert → PivotTable
  3. Confirm the range (auto-detected) → placing it on a new sheet is recommended
  4. Drag the fields you want in the Field List pane

Understanding the 4 areas

  • Filters area: filters the whole dataset (e.g., year)
  • Rows: row labels / vertical grouping
  • Values: aggregated values (sum, count, average)
  • Columns area: horizontal axis (e.g., quarter)
AreaRoleExample
RowsVertical-axis groupingRegion, department, product name
ColumnsHorizontal-axis groupingQuarter, month, year
ValuesAggregate calculationTotal revenue, average quantity
FiltersFilter the whole viewShow only a specific year

PivotTable: Practical Configuration

Changing the value aggregation method

The default is SUM, but you can switch it to something else.

Click the field name in the Values area → Value Field Settings

  • Choose Sum, Count, Average, Max, Min, StdDev
  • “Show Values As” → % of grand total, % of row total, etc.

Grouping dates

Placing a date field in Rows/Columns automatically groups it by year, quarter, or month.

Right-click the date field → Group

  • Choose years, quarters, months, weeks, or days
  • Selecting multiple options creates a hierarchical structure

Sorting and top-N filtering

  1. Right-click a row label
  2. Sort
  3. Descending (highest revenue first) Right-click a row label
  4. Filter
  5. Top 10 by value

Slicer

A button-based UI that filters a PivotTable with a single click.

Inserting a slicer

  1. Select the PivotTable
  2. PivotTable Analyze tab
  3. Insert Slicer
  4. Choose the field to filter by (e.g., region, product category)

Connecting multiple PivotTables

Right-click the slicer → Report Connections

  • Synchronize with other PivotTables that share the same data source
  • Filter multiple charts at once from a single dashboard

Timeline

A slicer specialized for date fields.

Select the PivotTable → PivotTable Analyze tab → Insert Timeline

  • Choose a period by year, quarter, month, or day
  • Drag to adjust the date range

PivotChart

A dynamic chart linked directly to a PivotTable.

How to create one

  1. Select the PivotTable
  2. PivotTable Analyze tab
  3. PivotChart
  4. Choose a chart type
  5. Insert

Characteristics:

  • The chart updates automatically whenever the PivotTable changes
  • Works together with slicers and timelines
  • Field buttons let you filter directly from within the chart

Standard Charts — Types and When to Use Them

Chart types and best uses

Chart typeBest forExample
ColumnComparing itemsComparing revenue by department
BarComparing items with long labelsWhen product names are long
LineTrends over timeMonthly revenue trend
PieShare of a wholeMarket share
DoughnutPie chart with center textKPI attainment rate
AreaCumulative trendCumulative sales by product
ScatterCorrelation between two variablesAd spend vs. revenue

Basic steps to build a chart

  1. Select the data range (including headers)
  2. Insert → Chart → choose a type
  3. Edit the chart title, axis labels, and legend
  4. Adjust the chart style/colors

Dual-Axis Charts (Combo Charts)

Used when you need to show two datasets with different units on the same chart.

Example: showing monthly revenue (in dollars) and growth rate (%) together

How to create one:

  1. Create a chart with both data series included
  2. Right-click the series you want on the secondary axis
  3. “Format Data Series” → “Secondary Axis”
  4. Change that series’ chart type (e.g., to a line)

Creating a combo chart directly

  1. Insert
  2. Chart
  3. Combo
  4. Set each series’ chart type and axis (primary/secondary)

Sparklines — Miniature In-Cell Charts

Ultra-compact trend charts sized to fit within a single cell.

Insert → Sparklines → Line/Column/Win-Loss

→ Choose the data range and where to display it

Use case: visualizing each row’s trend in an adjacent column next to a table


Formatting Charts — Practical Tips

Quick formatting

Select the chart → the ”+” button on the right:

  • Add/remove chart elements (title, data labels, gridlines, etc.) Select the chart → the paintbrush icon on the right:

  • Change the chart style and color theme

Adding data labels

  • Right-click the chart → Add Data Labels
  • Click a label → Format Data Labels → choose what to display
  • (value, series name, category name, percentage, etc.)

Formatting the chart axis

Double-click the axis → Format Axis

  • Fix the minimum/maximum value (when the auto range isn’t ideal)
  • Change display units (e.g., “thousands” for values in the 1,000s)
  • Set the date-axis interval

Example: Conditional PivotTable Aggregation

Steps for a monthly, by-department revenue analysis:

1. Prepare the source data — Date | Department | Rep | Revenue

2. Configure the PivotTable

  • Rows: Date (grouped by month)
  • Columns: Department
  • Values: Revenue (sum)
  1. Slicer: add a filter for Rep

  2. PivotChart: column + line combo

  • (columns: each department’s revenue, line: month-over-month growth rate)

5-Question Practice Quiz

Q1. When you place a date field in the “Rows” area of a PivotTable, how is it grouped by default?

  • ① Only shown at the daily level
  • ② Automatically grouped by year, quarter, and month
  • ③ Displayed as a plain date list with no change
  • ④ It causes an error

Answer: ② (Excel automatically applies hierarchical grouping to date fields)


Q2. Which statement correctly describes the difference between a slicer and a standard filter?

  • ① A slicer can only be used with numeric fields
  • ② A slicer can be connected to multiple PivotTables at once
  • ③ A standard filter offers more options
  • ④ A slicer can only be used with date fields

Answer: ② (A slicer’s key advantage is its report-connection capability)


Q3. Which situation is best suited to a dual-axis chart?

  • ① Comparing sales of the same product across colors
  • ② Displaying monthly revenue (in dollars) alongside customer satisfaction (a 1–5 scale)
  • ③ Ranking revenue by region
  • ④ Year-over-year revenue growth trend

Answer: ② (Use dual axes when comparing two metrics with different units)


Q4. How do you show ”% of row total” instead of the plain revenue sum in a PivotTable?

  • ① Type a ”%” symbol directly in the Values area
  • ② Value Field Settings → Show Values As → ”% of Row Total”
  • ③ Apply conditional formatting
  • ④ Calculate it separately with a SUMIF formula

Answer: ②


Q5. Which statement about sparklines is correct?

  • ① They’re created on a separate sheet, just like a normal chart
  • ② They’re a miniature chart displayed inside a single cell
  • ③ They support up to 100 data series
  • ④ They don’t print

Answer: ②

O

OIYO Editorial

Editorial Desk

The OIYO editorial desk researches money, law, lifestyle, and self-understanding topics against primary sources and public statistics. Every piece carries source notes and is reviewed on a regular cycle for accuracy and usefulness.