How can I get Distinct Count in Pivot in Mac Excel? - excel

I have a data set of 40,000 rows and I am looking to find count of distinct values for a specific column within the data set. I know Excel for Mac doesn't support data model. Has anyone found an alternate way to do this via formulas? Thank you for your help.

You can use the helper column to calculate the part of total items count in a group that can be summed in the pivot table.
For example, to get count of distinct names in group I divide 1 by total count of names in group
=1/SUMPRODUCT((A2=$A$2:$A$16)*(B2=$B$2:$B$16))
and in pivot table I can sum all parts.

Related

Formula in Excel Average in group

below i've shown the data I have and need what is present in the column Need. Its a pivot table but i'm not able to use it according to how i want. I need to sum it group wise. Groups are based on different colors and i want to divide each year by the group sum year number.
I've tried creating a calculated Field in pivot but that is also not showing it on parent level.
Thanks.
best regards,

How to remove the individual count under Subtotal in Excel Pivot Table with different rows count values

I want help in removing individual count under subtotal in Excel Pivot table, where rows count contains different values.
I know this question was asked earlier but in that row count was static which contain similar values,i.e "1" but in my pivot this rows count vary. I am currently using Excel 2016 version.
Below is the link on this:
How to disable to remove individual count under subtotal in Excel pivot table?
Below is what my pivot table data looks
Below is what I am expecting my pivot table should look
Thank you in advance
You can use conditional formatting to do this, based on whether the part number column contains the text "Total."
Similarly to the linked question, you'll need ;;; as the format.
The formula to use might be something like the following:
=NOT(ISNUMBER(SEARCH("Total",$A5)))

How to get distinct count within pivot table(Excel for Mac) having filters?

Excel for Mac doesn't support Power Pivot and thereby doesn't have distinct count feature.
What is the best workaround to get distinct count in such cases?
Sample Excel Columns:
Period Criteria1 Criteria2 Criteria3 Data
Sample Pivot table:
Different values in 'Period' will be pivot columns.
'Criteria1' can be a filter to pivot table.
Both 'Criteria2'&'Criteria3' columns can be pivot rows.
Now, count of 'Data' can be obtained directly through pivot.
How to obtain distinct count of 'Data' ?
Answer Options
Using 'Countif' on raw data - Cons: Very slow on large data.
Counting unique keys made by concatenating Criteria columns - Cons: Gets complex and takes more effort in large data with many criteria columns
Is there any better workarounds to obtain distinct count within pivot table(Excel for Mac) having filters/multiple criteria's?
I think I had a comparable problem and here's how I "fixed" it.
Add a column to the table named "DistinctValue" - or "Crit2:Crit3" doesn't matter
Add a formula, concatenating the values from all fields you have as a row in your pivot table: =[#Criteria2]&":"&[#Criteria3] -
depends a little bit on your values, but for me : as concatenator
works fine. Space or no character may also work.
Add a column "Distinct"
Add a formula: =IF(MATCH([#DistinctValue],Y:Y,0)=ROW([#DistinctValue]), 1, 0)
Use this row in the pivot as a value with SUM and name it "Count".
This gives you a 1 for every first row of distinct values in your data table which is used in your Pivot. The data rows used for the pivot table should have exactly one row with a 1 for each section of rows. If you sum it up, you exactly get the distinct count.
If you add a new row to the pivot, you need to add it to the formula in 2. to get distinct values again.
Edit: You probably have to exchange , with ; for other languages in the formulas when also translating the formula names to German for instance.
The following solution has a few steps, but the payoff is that it scales very nicely, because the formula is just as performant on large sets as on small ones, as opposed to lookup/match which get slower the larger the set is.
(1) Custom sort on the fields with the duplicate values. e.g.
"Email Address"
n.b. If you prefer to count a particular instance (i.e. the record with the latest creation date), set the sort so that those duplicates will appear first.
(2) Create a new column, Call it Unique Count or what have you. In that column use a formula that is 1 if the preceding value and current value are not equal. E.g. =IF(EXACT(A2,A3),0,1)
(3) Fill down.
(4) Pivot on this table. Now when you do Count/Sum, use the Unique Count.

Grouping by and summing in Excel

I have a table in Excel that consists of two columns, Name and Score. The Name column is not unique, many names appear several times. I want to create another table that using formulas groups by name and calculates the total score for each.
So if James had 3 records with scores 2, 8 and 4, the other table would show James with total score 14. How do I do this?
You need to create a pivot table. Select the data you want to use and then go to the Insert tab on the ribbon and select Pivot Table. After the pivot table is created you need to add the Name column to the Rows section of the pivot table and the Score column to the Values section. Then change the Values calculation from count to sum.

Distinct Count by Date in PowerPivot Column

I have a client I am importing lots of data from but to narrow it down it pulls in to powerpivot with a date column and a product column. They want to see a summary of how many days there was one item sold ("Solo Sale") two ("Double Sale") three, and four or more.
I am running into trouble due to the fact that they want to summarize the rest of their data by whether the day was a "Solo Sale" or "Double Sale" etc etc. Let's call this this the "Sale Count"
Because I need these "Sale Count" values on the rows of a Pivot Table, I'm trying to build a calculated column in the table that does a distinct count of the products by date but can't quite seem to get there using CALCULATE and/or FILTER. It always seems to give me a total distinct count of the products in the entire table rather than counting by each date.
Any advice on the DAX formula I should be using would be greatly appreciated. New to Power Pivot and I think I'm still thinking a little too excel-centric given there is very little row-logic in Power Pivot.
Thanks in advance!
Edited: Here is the table
PowerPivot Table
I would like the values in the SalesCount column to read 4 for every row with a date 1/1/2016, 1 for 1/2/2016, 2 for 1/3/2016, and 2 for 1/4/2016 (equivalent to the DISTINCTCOUNT of the Products on each day).
Then I would like to use conditional IF statements to replace those numbers with "Solo Sale" "Double Sale" etc so that I can use these values on the rows of a Pivot Table.
Try this as your calculated column:
=CALCULATE(
DISTINCTCOUNT(Table1[Product]),
ALLEXCEPT(Table1, Table1[Date])
)

Resources