COUNT UNIQUE in Excel Pivot

If you just need to count unique in excel pivot and move on, the boxed answer at the top is all you need. The rest of this page is for when you want to understand why it works in Excel, adapt it to a trickier version, or make it robust enough to hand to a colleague. We keep the opening short on purpose — the depth is here when you want it, not in your way when you don’t.

Exact answer

In Excel: create the PivotTable with "Add this data to the Data Model" ticked, drag the field into Values, then Value Field Settings ▸ Summarize value field by ▸ Distinct Count.

On this page7
ƒxQuick Pivot SummarizerLive
Groups
3

Grand total: 1,250.50

RegionSum
West125.50
East1050
South75

The same thing in your own sheet

Sum · Excel & Sheets

Put your group keys in a column (here starting at E2) and fill the formula down.
Real pivot table: Excel — select your data, Insert → PivotTable, drag the group column to Rows and the value column to Values. Google Sheets — select the data, Insert → Pivot table. · Runs entirely in your browser — your data never leaves this page.
Ctrl+CthenCtrl+Shift+V+Cthen+Ctrl+VPaste values · WindowsMac

What this does

A normal PivotTable can Count rows but not count each different value once. Distinct Count becomes available when the PivotTable is built on the Data Model, which you choose with a checkbox in the Create PivotTable dialog. The setting is fixed when the PivotTable is created, so an existing PivotTable without it has to be rebuilt. The Data Model option is not available in every Excel edition; where it is missing, a helper column that marks the first occurrence of each value gives the same result with an ordinary Sum. Before you run it on a workbook other people depend on, try it on a copy or a few rows first. Undo only reaches back through the current session, so a quick trial run is the cheapest way to see exactly what will change before the file is saved and shared. Treat “count unique in excel pivot” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected pivot table shows up while it is still harmless. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That turns a data step that keeps your analysis trustworthy into a method you can reuse, explain, and defend when the workbook leaves your screen.

A worked example

An orders table has 10 rows for 4 customers. Insert ▸ PivotTable, tick Add this data to the Data Model, put Region in Rows and Customer in Values. Count of Customer shows 10; open Value Field Settings, choose Distinct Count, and it shows 4. Without the Data Model, add a column with =IF(COUNTIF($B$2:B2,B2)=1,1,0) and sum that column in the PivotTable. How many different customers, products or users per region is a different question from how many rows — and it is the one most reports actually need. When the result is not what you expected, undo straight away rather than repairing it by hand — undo restores the sheet exactly, while manual fixes tend to leave small inconsistencies behind that surface later.

In Google Sheets

This is a command rather than a formula, so there is no syntax to carry over. Google Sheets arranges its commands in menus across the top instead of a ribbon, names some of them differently and does not have every Excel command — look for the equivalent in the Sheets menus or its help before assuming the steps match. Keep this page bookmarked for the next time the same question comes up. Better still, rebuild the example once in your own sheet — doing it yourself, with the tool above to check against, is what turns a copied formula into a technique you own. Treat “count unique in excel pivot” as a routine rather than a one-off. Once you know which setting or command controls it, the same few steps handle every workbook where it comes up in Excel, and you can explain them to a colleague in a sentence.

Common mistakes

  • Looking for Distinct Count on a PivotTable that was not created with the Data Model — rebuild it with the box ticked.
  • Using Count, which counts rows, not different values.
  • Helper-column counts that break when the PivotTable is split by a second field, because the first occurrence is counted only once overall.
  • Trailing spaces or different spellings making the same customer count twice.

Frequently asked questions

Why is Distinct Count missing from Value Field Settings?

The PivotTable was not added to the Data Model. Create a new PivotTable and tick Add this data to the Data Model.

Can I count unique values with a formula instead?

Yes — in Excel with dynamic arrays, =COUNTA(UNIQUE(B2:B11)) counts the different values in a range.

Can I change an existing PivotTable to Distinct Count?

Only if it was created on the Data Model. Otherwise insert a new PivotTable from the same data with the Data Model box ticked.

Other ways people ask this

On the way here you may have searched this as “excel pivot unique count”, “unique count excel pivot” and “excel pivot count unique” — it is all the same task, and this page is the single, complete answer to it.

Why do people search for this in so many different ways?

Because the same task has many names. “excel pivot unique count”, “unique count excel pivot”, “excel pivot count unique” all point at the one operation explained on this page, which is why they all lead here.