Count unique names (based on gender) using pivot table - excel

I have a table which consist of 7 students and three age ranges (<=13, 14-17 and 18-20). I want to count the number of students that fall into these age ranges (based on their gender) using pivot table. I was able to use pivot table to categorize the students under the different age ranges but I'm not able to get the total number of students for each range. How do I go about it?

If I understand you correctly, what you need in the Values section is a "distinct count" of the student names.
*I'm not sure what you mean when you write "by gender" as you do not show your desired results
In order for this to show up when you Insert a Pivot Table, select the Option to Add to Data Model
Then, when you select the Value Field Settings, you'll see the distinct count option
Voila!

Related

Columns in pivot table - text values and different filters in certain columns

I need to create a certain pivot table in excel. As you can see on the picture there are certain Lane IDs and supplier names. I would like to describe my problem on the Lane ID RSE_0010 example.
There are two supplier names first: EMES has lower sum of price (235) and UNIMED has higher (295),
I need to create such pivot that I could see such order for RSE_0010 row:
RSE_0010|Supp.Name with lowest Price|Price of the Supplier with lowest price|Supp.Name with second price|Second Price value
I need to have supplier names for each Lane not in rows but in columns with their prices values.
I have two problems here:
how to have supplier names in columns one after another for each row
how to filter the prices in the columns
Hope you could help me with my problem and it has been described in a clear way.
Thanks in advance.

Pivot Table distinct count of employees

In Excel I have raw data that looks like this:
I am creating a pivot table that lists employees and the days they punched in by department / shift.
I'd like the Employee Count to give a count of the distinct number of employees in the particular Department / Shift. Currently the pivot table is showing a count of the total number of rows in which each employee appears.
Instead of 1st SHIFT Warehouse 44th having a total of 69 I want it to have a total of 5. And no values alongside the individual employee rows. When I change Count to Sum I get values of 0.
How can I achieve this?
When creating the pivot table, check the box for "Add this data to the data model". Then design your pivot table, doing on a count on employee. Lastly, right click on the employee count in your pivot, go to Value Field Settings, and change your Summarize to Distinct Count.

How can I get Distinct Count in Pivot in Mac 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.

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.

How to sum the number of rows in a pivot table?

I would like to have the number of voters per age group per party in this
excel sheet .
In SQL it would be something like
SELECT COUNT(*) from VOTING GROUP BY AGEGROUP GROUP BY PARTY
This might not be proper SQL syntax but you better get the idea what I want.
I created a pivot table and selected AGE GROUP and PARTY as rows but it is not clear how could I sum the number of voters in the cross-section of this two aspects.
There is a greek Sigma VALUES fiels right below but it is not clear how could I use that for summing up -- there is no menu on right-click.
How can count the rows per AGE GROUP per PARTY?
One approach is to use the party as columns and AGE GROUP as rows or vice versa
If he results is not comfortable for you to read then you can make additional row to your row data which concatenate the rows "age group" and "party" together.
This formula combines cells a1 and b1 together with comma inside:
=A1&","&B1
Just drag the formula to all of the rows…
Than make a pivot table and add for the rows only the additional column you just made
I added the comma so you can split them back easily with text to columns.
Try this:
SELECT
count(Voter) over (partition by PARTY, AgeGroup) as Counter, Party, AgeGroup
FROM Voting

Resources