How to Use Pivot Table to Count Unique Values in Google Sheets

When dealing with large datasets in Google Sheets, duplicate values are commonly encountered. You might occasionally decide to focus just on the unique values in the dataset. It takes a lot of time to manually locate unique data. To locate unique values quickly, we can use Google Sheets’ features or functions. We can even use a pivot table to count the unique values in our dataset. In this article, I’ll demonstrate the step-by-step process of using a pivot table to count unique values in Google Sheets. Here is an overview of what we will achieve:

Overview of How to Use Pivot Table to Count Unique Values in Google Sheets


Step-by-Step Process to Use Pivot Table to Count Unique Values in Google Sheets

We will use the dataset below to demonstrate the step-by-step process of using a pivot table to count unique values in Google Sheets. The database contains the top-selling items from a certain retailer for each week and month. We’ll now make a pivot table and count the unique values of the best-selling items for each month.

How to Use Pivot Table to Count Unique Values in Google Sheets


Step 1. Create a Pivot Table

Firstly, we have to create a pivot table to summarize our dataset and count the unique values of the best-selling items for each month. To do so, follow the steps below-

  • Firstly, select the entire dataset to create a pivot table. In our case, we selected Cell B4:D16. Next, go to the Insert tab from the top menu bar and select Pivot table.

Creating a Pivot Table to Count Unique Values in Google Sheets

  • As a result, a dialog box named Create pivot table will appear. It will ask you whether you want to insert the pivot table into a new sheet or the existing sheet. In this case, we choose the New sheet option. Now, click on the Create option to create the pivot table.

Creating a Pivot Table to a New Sheet

  • Thus, it will create a pivot table to a new sheet for your dataset.

Output after Creating a Pivot table

Read More: How to Get Unique Values Without Blanks in Google Sheets


Step 2. Add Rows

Now, you have to add rows to the pivot table to count the unique values across the rows. We want to count the unique values of the best-selling items for each month. So we have to add months as rows for our pivot table.

  • Firstly, click on the Add option next to the Rows section and choose Month.

Add Rows to Pivot Table to Count Unique Values in Google Sheets

  • As a result, it will add every month of our dataset as a row of the pivot table.

Output after Adding Rows

Read More: How to Filter Unique Rows in Google Sheets (4 Easy Ways)


Step 3. Add Values

Next, we have to add Values to the pivot table. As we want to count the unique values of the best-selling product, we have to add the Best Selling Item column as values for our pivot table.

  • First, click on the Add option next to the Values section and choose Best Selling Item.

Add Values to Pivot Table to Count Unique Values in Google Sheets

  • Thus, it will add the Best Selling Item as Values of our pivot table.

Output after Adding Values

Read More: How to Filter Unique Values in Google Sheets (5 Simple Ways)


Step 4. Inserting COUNTUNIQUE Function

Finally, we have to use a function to count the unique values. Here, we’ll use the COUNTUNIQUE function to count the unique values of the best-selling items for each month.

  • First, click on the drop-down icon under Summarize by section of the Best Selling Item field.

Inserting COUNTUNIQUE Function in Pivot Table to Count Unique Values in Google Sheets

  • Next, choose COUNTUNIQUE from the list.

Choosing COUNTUNIQUE Function

  • As a result, it will count the unique values of best-selling products for every month.

Output After Inserting COUNTUNIQUE Function

Read More: Use COUNTIF Function to Count Unique Values in Google Sheets


Conclusion

This brings up the end of our article. In this article, I’ve covered the step-by-step process of using a pivot table to count the unique values in Google Sheets. I hope this will help you to count unique values using a pivot table in Google Sheets. Please feel free to comment with any queries or suggestions in the comment section below. Visit our site Officewheel.com to explore more.


Related Articles

Sishir Roy

Sishir Roy

Hello, I'm Sishir Roy. I currently work for the SOFTEKO company at officewheel.com as a technical writer and content developer. I completed my BSc degree in civil engineering from BUET. I like using my talents as a creative problem-solver and thinker to come up with innovative solutions to problems. I have a great interest in the research and development of data science. Please follow my blog at Officewheel.com for more Google Sheets solutions.

We will be happy to hear your thoughts

Leave a reply

OfficeWheel
Logo