Counting data

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,832
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Assume I have this column of data:

Rich (BB code):
a
b
c
d
e
a
b

If I type in cell D1:

Rich (BB code):
=COUNTIF(A:A,A1)

and copy the formula down, I get:

Rich (BB code):
2
2
1
1
1
1
1

which is correct.

But what I am seeking is:

Rich (BB code):
1 of 2 ' because it's the 1st a of 2
1 of 2 ' because it's the 1st b of 2
1 of 1 ' because it's the only c
1 of 1 ' because it's the only d
1 of 1 ' because it's the only e
2 of 2 ' because its the 2nd a of 2
2 of 2 ' because its the 2nd b of 2

How can this achieved?

Thanks
 
Last edited:

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Hey,

How about:
=COUNTIF($A$1:A1,A1) then drag that down
 
Upvote 0
How about
=COUNTIF(A$1:A1,A1) & " of " &COUNTIF(A:A,A1)
 
Upvote 0
Brilliant to both.

My weekend's started early!

Have a great one yourselves.
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0
Thanks, you have a good one too! Sorry I missed the extra bit " of " & next formula - thought you just wanted the numbers :p
 
Upvote 0

Forum statistics

Threads
1,214,647
Messages
6,120,722
Members
448,987
Latest member
marion_davis

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