ExcelReady
CourseMock testsFunction guidesBlog
Start freeStart learning for free
ExcelReady

Be Excel-ready before day one. Hands-on practice in your browser, with instant feedback.

Learn

  • Course
  • Mock tests
  • Function guides
  • Blog

Test prep

  • Excel level test
  • Excel test practice
  • Free screening quiz
  • Certificate

Company

  • About
  • Editorial policy
  • Contact
  • Terms
  • Privacy

© 2026 ExcelReady. All rights reserved.

  1. Blog
  2. Data tools
  3. Count in a Pivot Table: Count vs Distinct Count

Count in a Pivot Table: Count vs Distinct Count

By ExcelReady Team·Updated November 1, 2026·5 min read

The short answer

To count in a pivot table, drag a field into Values and set it to Count: right-click a number, choose Summarize Values By, then Count. Count adds up rows, so a customer with three orders counts three times. To count each customer once, tick Add this data to the Data Model when you create the pivot, then use Distinct Count.

Key takeaways

  • Text fields in Values count automatically; number fields sum, so switch them with Summarize Values By > Count.
  • Count counts non-empty cells, like COUNTA; Count Numbers counts only numbers, like COUNT.
  • Distinct Count counts each value once, but only in pivots added to the Data Model.
  • Count an ID column that is never blank, so every row is counted.
  • COUNTIFS and COUNTA(UNIQUE(FILTER())) check pivot counts with formulas.
On this page+
  1. How to count rows in a pivot table
  2. How to change Sum to Count
  3. Count vs Count Numbers
  4. How to use Distinct Count in a pivot table
  5. How to check a pivot table count with formulas
  6. Why is my pivot table count wrong?
  7. Practise it

A pivot table count tells you how many rows fall in each group: orders per region, tickets per agent, sales per month. You get it by putting a field in Values and setting it to Count. When you need to count each customer or product only once, you need Distinct Count instead. This guide shows both, explains why the two numbers differ, and how to check them with formulas.

How to count rows in a pivot table#

To count, put a field in the Values area and make sure it summarizes by Count. The examples use this order list in A1:D9:

ABCD
1OrderCustomerRegionAmount
21001AcmeEast4200
31002BirchWest1850
41003AcmeEast3100
51004CedarSouth5600
61005BirchWest2400
71006DeltaEast980
81007AcmeNorth1500
91008CedarSouth3300
  1. Click inside the data and choose Insert > PivotTable, then OK.
  2. Drag Region to Rows.
  3. Drag Customer to Values.

Because Customer is a text field, Excel uses Count by default. The pivot shows Count of Customer: East 3, North 1, South 2, West 2, Grand Total 8. That's the number of orders in each region. The beginner's guide to pivot tables covers the basic layout in more detail.

How to change Sum to Count#

Number fields go into Values as Sum. To count them instead:

  1. Right-click any number in the values area.
  2. Choose Summarize Values By > Count.

You can also click the field's drop-down arrow in the Values box, choose Value Field Settings, and pick Count on the Summarize Values By tab. While you're there, click Number Format to set how the values look.

Sometimes Excel picks Count for a number column on its own. That happens when the column has at least one blank cell or a number stored as text. If a sales column shows counts instead of totals, look for those cells first.

Count vs Count Numbers#

The Summarize list has two counting options, and they behave like two worksheet functions:

Pivot optionCountsWorksheet equivalent
CountEvery non-empty cell: numbers, text, datesCOUNTA
Count NumbersOnly cells holding numbersCOUNT

Neither counts blank cells. So if you count a column where some cells are empty, those rows quietly drop out of the total. The safest field to count is one that is never empty, such as an order ID or ticket number. In the table above, counting Order gives the same 3, 1, 2, 2 as counting Customer, because no cell is blank.

How to use Distinct Count in a pivot table#

Count adds up rows, so Acme, with two East orders, counts twice. If the question is "how many different customers bought in each region?", use Distinct Count:

  1. Click inside the data and choose Insert > PivotTable.
  2. In the dialog, tick Add this data to the Data Model, then click OK.
  3. Drag Region to Rows and Customer to Values.
  4. Click the drop-down on Count of Customer in the Values box and choose Value Field Settings.
  5. Scroll to the bottom of the list, choose Distinct Count and click OK.
RegionCount of CustomerDistinct Count of Customer
East32
North11
South21
West21
Grand Total84

Notice the Grand Total for Distinct Count is 4, not 2 + 1 + 1 + 1 = 5. Acme bought in East and North, but it's one customer overall. Distinct totals never simply add up, which is correct, but it surprises people.

Distinct Count only appears in pivots built on the Data Model, an option in Excel for Windows (2013 and later). You can't switch it on for an existing pivot; build a new one. If you don't see the checkbox, use the formula method below.

How to check a pivot table count with formulas#

Formulas give the same answers and are a good way to check a pivot. For the order count per region, use COUNTIF or COUNTIFS:

Excel formula
=COUNTIF(C2:C9,"East")

The result is 3, the same as the pivot. For distinct customers in the East, combine three functions:

Excel formula
=COUNTA(UNIQUE(FILTER(B2:B9,C2:C9="East")))

FILTER returns Acme, Acme, Delta. UNIQUE shortens that to Acme, Delta. COUNTA counts them: 2. UNIQUE and FILTER need Excel 2021, Excel 2024 or Microsoft 365. For when to use a table and when a pivot, read Excel table vs pivot table.

Why is my pivot table count wrong?#

Most wrong counts come from the data or a stale pivot. Check these:

  • New rows are missing. A pivot doesn't update by itself. Right-click it and choose Refresh, and make sure the source range includes the new rows. See how to refresh a pivot table.
  • The count is too low. The counted field has blank cells. Count an ID column instead.
  • The count is too high. You need Distinct Count, not Count, because the same customer appears in many rows.
  • "Banana" and "banana " count separately. A trailing space makes a different item. Clean the data with TRIM and refresh.
  • The pivot won't build. A blank header causes the "PivotTable field name is not valid" error. Here is how to fix the field name error.

To show each count as a share of the total, right-click a value and choose Show Values As > % of Column Total.

Practise it#

Counting by group is one of the most common pivot questions in interviews and job tests. Practise pivot tables in a live spreadsheet: build a pivot, switch from Sum to Count and Average, and read the answers off it. For interview prep, go through the pivot table interview questions next.

Try it yourself

This is a live spreadsheet. Type the formula in the green cell and press Enter.

A pivot with Distinct Count would show how many different customers ordered in the East. Get the same answer with a formula: in G2, use COUNTA, UNIQUE and FILTER to count the distinct customers in B2:B9 where the region in C2:C9 is East.

fx
ABCDEFGH
1
Order
Customer
Region
Amount
2
1001
Acme
East
4200
East customers
3
1002
Birch
West
1850
4
1003
Acme
East
3100
5
1004
Cedar
South
5600
6
1005
Birch
West
2400
7
1006
Delta
East
980
8
1007
Acme
North
1500
9
1008
Cedar
South
3300
10
11
12

Tip: Work from the inside out: FILTER the customers for East, UNIQUE removes repeats, COUNTA counts what is left.

Practise this in a lesson

LessonPivot tables 1Build your first PivotTable on a new sheet: total sales by region, split them by product, then switch the summary from Sum to Count and Average and read the answer off the pivot.

Frequently asked questions

How do I count in a pivot table instead of sum?

+

Right-click any number in the values area, choose Summarize Values By and pick Count. You can also open Value Field Settings from the field's drop-down in the Values box.

How do I count unique values in a pivot table?

+

When you create the pivot, tick Add this data to the Data Model. Then open Value Field Settings for the field and choose Distinct Count. Existing pivots without the Data Model don't offer this option.

Why is my pivot table counting instead of summing?

+

The number column has at least one blank cell or a value stored as text, so Excel defaults to Count. Fix the data, then switch the field back to Sum with Summarize Values By.

What is the difference between Count and Count Numbers in a pivot table?

+

Count counts every non-empty cell, including text. Count Numbers counts only cells with numbers. They match COUNTA and COUNT in a worksheet.

Why doesn't Distinct Count appear in my pivot table?

+

The pivot wasn't created with the Data Model. Rebuild it from Insert > PivotTable with Add this data to the Data Model ticked. This option is in Excel for Windows; on other versions, use a formula instead.

Sources

  • Create a PivotTable to analyze worksheet data - Microsoft Support
  • COUNTIFS function - Microsoft Support
  • UNIQUE function - Microsoft Support

Written and checked by the ExcelReady Team. First published November 1, 2026. The practice exercise runs in the same formula engine as our lessons. Found a mistake? Read our editorial policy or email hello@excelready.app.

On this page

  1. How to count rows in a pivot table
  2. How to change Sum to Count
  3. Count vs Count Numbers
  4. How to use Distinct Count in a pivot table
  5. How to check a pivot table count with formulas
  6. Why is my pivot table count wrong?
  7. Practise it

Keep reading

Data tools· 5 min read

Pivot Tables in Excel: A Beginner's Guide

A pivot table summarizes a long table in a few clicks, without formulas. Click a cell in your data, choose Insert > PivotTable, and click OK to put it on a new sheet. Then drag fields into Rows, Columns and Values: Region in Rows and Sales in Values gives total sales for each region.

Data tools· 5 min read

How to Refresh a Pivot Table (and Why It Doesn't Update)

To refresh a pivot table, right-click anywhere in it and choose Refresh, or press Alt+F5 on Windows. Use Data > Refresh All (Ctrl+Alt+F5) to update every pivot in the file. If new rows still don't appear, they're outside the source range: use PivotTable Analyze > Change Data Source, or build the pivot on an Excel table so the range grows.

Errors & fixes· 5 min read

"PivotTable Field Name Is Not Valid": How to Fix It

Excel shows "The PivotTable field name is not valid" when a column in the source data has no header. Every column in the range needs a label in the first row. Type a header into any blank header cell, unmerge merged headers, and make sure the source range has no empty columns. Then create or refresh the pivot.

More on data tools

  • Group Dates by Month or Year in a Pivot Table
  • Pivot Table Tricks: Subtotals, Filters and % of Total
  • How to Reference Another Sheet in Excel
  • How to Remove Duplicates in Excel (3 Ways)
  • Slicers in Excel: Click-to-Filter Pivot Tables
  • How to Sort Data in Excel by One or More Columns
All data tools articles →

Don't just read about Excel. Do it.

Practise real formulas in a live spreadsheet with instant feedback, right in your browser. Nothing to download.

Start learning for free