PowerPivot Structured Reference for COUNTIF

SerenityNetworks

Board Regular
Joined
Aug 13, 2009
Messages
131
Office Version
  1. 365
Platform
  1. Windows
I simply want to count the number of students in a class. In my example, I have:
4 in Class 1,
3 in Class 2,
3 in Class 3,
6 in Class 4,
3 in Class 5, and
6 in Class 6.

I want to use the values in a Pivot Chart (as shown in the attached image). The formula I have now works, but it seems rather kludgy.
Class Size:=COUNTAX(FILTER('Table2',[Passed]="y"),[Class]) + COUNTAX(FILTER('Table2',[Passed]="n"),[Class]) + COUNTAX(FILTER('Table2',[Passed]="n/a"),[Class])

I imagine there is a better way to get the count of students in a class, but I'm struggling with the structured references syntax. Any help will be appreciated.

Class Size.jpg
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Never mind. It took a long time of digging and testing of numerous formulas found in searches, but the following seems to be working fine.
Class Size:=COUNTAX(FILTER('Table2',[Class]),[Class])
 
Upvote 0
Solution

Forum statistics

Threads
1,223,952
Messages
6,175,596
Members
452,658
Latest member
GStorm

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