Count Occurance in Column

James02

Board Regular
Joined
Nov 6, 2014
Messages
108
Hi,

I hope this calculation is easy to figure out. I want to write a calculated column or measure to count the number of times a value occurs in another column.

Column #1
Joe
Joe
Joe
John
Alex

So I would want Column #2 to be:
3 (for three joes)
3 (for three joes)
3 (for three joes)
1 (for one john)
1 (for one alex)

Is this simple calculation I'm missing? Thank you!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
That formula requires R1C1 which PowerPivot does not use. It would look like = COUNTIF('Table'[Name],'Table'[Name]). But that returns an error.
 
Upvote 0
I found the solution in another thread in this forum. For a Excel formula such as =COUNTIF(A:A,A1).

PowerPivot Equivalent is:

=CALCULATE(COUNTROWS(TableName), ALLEXCEPT(TableName, TableName[Items]))
 
Upvote 0
You can use just COUNTROWS in your measure and then let the table to do rest with. Putting Column1 in rows will get you the counts you want.

Count:=COUNTROWS(TableName)
 
Upvote 0
You can use just COUNTROWS in your measure and then let the table to do rest with. Putting Column1 in rows will get you the counts you want.

Count:=COUNTROWS(TableName)

Are you sure? This gives me the a value of "1".
 
Upvote 0

Forum statistics

Threads
1,224,106
Messages
6,176,378
Members
452,726
Latest member
HaploTheGreat

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