Welcome to Module 5 of Pivot Tables in Excel!
In the previous module, you learned how to arrange information using the Rows, Columns, Values and Filters areas. Now, we will learn how to use PivotTables to perform calculations.
Imagine you are managing a supermarket in Ibadan. You have hundreds of sales records, and your manager wants to know:
Instead of calculating everything manually, you can use PivotTables to find these answers quickly.
PivotTable calculations are operations Excel performs on your data to produce useful information.
For example, if a supermarket records the following sales:
| Transaction | Product | Sales |
|---|---|---|
| 001 | Rice | ₦50,000 |
| 002 | Beans | ₦24,000 |
| 003 | Milk | ₦12,000 |
| 004 | Rice | ₦20,000 |
Excel can calculate the total sales, average sales, highest sales and lowest sales from these records.
Sum means adding numbers together.
For example, if a supermarket records sales of ₦50,000, ₦24,000, ₦12,000 and ₦20,000, the total sales are:
₦50,000 + ₦24,000 + ₦12,000 + ₦20,000 = ₦106,000
A PivotTable can calculate this total automatically.
Excel will usually use Sum of Sales when the Sales field contains numerical values.
Your report may look like this:
| Product | Total Sales |
|---|---|
| Beans | ₦24,000 |
| Milk | ₦12,000 |
| Rice | ₦70,000 |
| Grand Total | ₦106,000 |
Count tells you how many records or entries are in your dataset.
Imagine a supermarket wants to know how many sales transactions were recorded during the week.
If there are 100 transaction records, the count is 100.
Excel will count the non-empty transaction IDs for each product.
Your report may look like this:
| Product | Number of Transactions |
|---|---|
| Beans | 1 |
| Milk | 1 |
| Rice | 2 |
| Grand Total | 4 |
Count counts non-empty entries. If you want to count numerical values only, use Count Numbers where available. If you want to count distinct customers or unique IDs, you may need a suitable Data Model or another method.
Average means adding a group of numbers and dividing the result by how many numbers there are.
For example, imagine three customers spend the following amounts:
The average spending is:
(₦5,000 + ₦10,000 + ₦15,000) ÷ 3 = ₦10,000
Excel will now display the average sales amount for each product instead of the total.
For example, if Rice has sales of ₦50,000 and ₦20,000, its average sales amount is:
(₦50,000 + ₦20,000) ÷ 2 = ₦35,000
Maximum means the highest value in a group of numbers.
For example, imagine a supermarket records these daily sales amounts:
The maximum sales value is ₦50,000 because it is the highest amount.
Excel will display the highest sales amount for each product.
Minimum means the lowest value in a group of numbers.
For example, if a supermarket records the following daily sales:
The minimum sales value is ₦20,000.
Excel will now show the lowest sales amount for each product.
Let's review the calculations we have learned.
| Calculation | Meaning | Example |
|---|---|---|
| Sum | Adds numbers together | Total sales |
| Count | Counts non-empty records | Number of transactions |
| Average | Calculates the mean | Average customer spending |
| Max | Finds the highest value | Highest sales amount |
| Min | Finds the lowest value | Lowest sales amount |
You do not need to create a new PivotTable every time you want a different calculation.
You can change the calculation used in the Values area.
Follow these steps:
Your PivotTable will update using the new calculation.
Sometimes, a business manager wants to see more than one calculation at the same time.
For example, the supermarket manager may want to see:
You can do this by adding the same field to the Values area more than once, then changing each calculation.
Your report may look like this:
| Product | Total Sales | Average Sales | Transactions |
|---|---|---|---|
| Beans | ₦24,000 | ₦24,000 | 1 |
| Milk | ₦12,000 | ₦12,000 | 1 |
| Rice | ₦70,000 | ₦35,000 | 2 |
This report gives the manager three different types of information in one place.
Sometimes, your PivotTable may display numbers without the currency symbol or with too many decimal places.
You can format your results to make them easier to read.
Your values will now display in a more professional format, such as ₦50,000.00.
Use Number Format through Value Field Settings where possible. This helps preserve the formatting when the PivotTable is refreshed.
One common problem beginners experience is seeing Count instead of Sum in the Values area.
Why does this happen?
Excel may use Count when it detects that a numerical column contains text, blanks or other inconsistent entries.
For example, imagine your Sales column contains:
Because the column contains text, Excel may choose Count instead of Sum.
To solve this problem:
Never replace missing sales information with a guessed amount. Always check the original transaction records.
It is time to practise your new skills.
Imagine you are working as a junior data analyst for a supermarket with branches in Ibadan and Lagos.
The manager wants you to prepare a sales report.
Your tasks:
Prepare one PivotTable showing total sales, average sales and number of transactions for each product. Write down which product has the highest total sales.
Choose the correct answer for each question.
What does the Sum calculation do?
A. Deletes numbers
B. Adds numbers together
C. Finds the smallest number
D. Counts text characters
Which calculation finds the average value?
A. Count
B. Max
C. Average
D. Min
Which calculation finds the highest value?
A. Max
B. Min
C. Count
D. Sum
Which calculation finds the lowest value?
A. Average
B. Sum
C. Count
D. Min
What does Count calculate?
A. The highest price
B. The number of non-empty entries
C. The average sales value
D. The total amount of money
Where can you change the calculation used by a PivotTable field?
A. Page Layout
B. File menu
C. Value Field Settings
D. Print Preview
What is the average of ₦5,000, ₦10,000 and ₦15,000?
A. ₦10,000
B. ₦15,000
C. ₦20,000
D. ₦30,000
Which field should you use to calculate the total number of items sold?
A. Product
B. Branch
C. Date
D. Quantity
Why might Excel use Count instead of Sum?
A. The workbook has a blue heading
B. The numerical field may contain text or inconsistent entries
C. The computer is switched on
D. The worksheet has a name
Can you add the same field to the Values area more than once?
A. No
B. Only once per workbook
C. Yes
D. Only when printing
| Question | Correct Answer |
|---|---|
| 1 | B |
| 2 | C |
| 3 | A |
| 4 | D |
| 5 | B |
| 6 | C |
| 7 | A |
| 8 | D |
| 9 | B |
| 10 | C |
Congratulations! You have completed Module 5.
You have learned how to use PivotTables to calculate sums, counts, averages, maximum values and minimum values. You also learned how to change calculations using Value Field Settings, display multiple calculations in one report and format your results.
These skills are useful for analysing supermarket sales, school records, business transactions, customer information and many other types of data.
Sorting, Filtering and Grouping PivotTable Data
In the next module, you will learn how to arrange information from highest to lowest, filter reports to show selected records, and group dates and other categories to make your analysis easier.