Alternative for use of SUMPRODUCT or Pivot Table Distinct Count Function

Xlitup

New Member
Joined
Jan 16, 2018
Messages
22
Hey Everyone,

I would really appreciate if someone can find me solution for this problem.

I am using a Pivot table and need to use it as making interconnected graphs and it's just easier.

However as when I want a count of something it counts all the rows in that column with the data but not just unique values.

So as to count all the distinct values in my table, first I tried to create a pivot data model which would give me a Distinct Count option but as there is a bug in Excel 2016, the misplaces the Data Model file and the workbook becomes corrupt.

Then I tried adding a column in the table which displays 1 for distinct and 0 for repeated values using the formula =IF(SUMPRODUCT(($A$6:$A6=A6)*($B$6:$B6=B6))>1,0,1). But this slows the whole report and as I am running queries it takes ages and most of the time have to just close the report as takes more than 8 hours.

Any solution with a formula or macro to add a value of displaying distinct values in a new column which can then be added to the pivot table.

Using SUM and countif have the same issues as SUMPRODUCT so if anything which will be quicker would be great. Anything between 10-15 min on a query run as a wait time is acceptable.

Looking forward hearing from you all.
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top