Counting data

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,924
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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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
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 :nya:
 
Upvote 0

Forum statistics

Threads
1,224,744
Messages
6,180,697
Members
452,994
Latest member
Janick

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