Count what Instance an Occurance is

TheRogue!

Board Regular
Joined
Mar 2, 2012
Messages
84
Office Version
  1. 2021
Platform
  1. Windows
I've got a table. The headers for the table are individuals.
The first data row of the table is what group the individuals are in (either Red or Blue).

On the next row of data, in the table, I need it to count what instance the occurance is (not the total number of occurances).
The first time it comes accross the value Blue in the data it needs to report "1", the next time it comes across "Blue", "2" & so on.

I know that there are 5 people in the Red group & 4 in the Blue group, so COUNTIF doesn't help me. I need it to number the people in the Red group 1-5 & the people in the Blue group 1-4.

It is also possible that the data in the group row will change (someone from Blue may go to Red), so I need to do this dynamically, w/ a formula.

Example:
STANEARLJIMCATHYLIZMURRAYLISAELIPETE
1BLUEBLUEREDREDBLUEREDREDREDBLUE
2121233454
3
4
5
6

<COLGROUP><COL style="WIDTH: 48pt" span=10 width=64><TBODY>
</TBODY>
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
In A3:
=COUNTIF($A2:A2,A2)

Copy across.

Excel Workbook
ABCDEFGHI
1STANEARLJIMCATHYLIZMURRAYLISAELIPETE
2BLUEBLUEREDREDBLUEREDREDREDBLUE
3121233454
Sheet1
 
Upvote 0
I don't understand why COUNTIF won't suffice?

Excel Workbook
ABCDEFGHI
1STANEARLJIMCATHYLIZMURRAYLISAELIPETE
2BLUEBLUEREDREDBLUEREDREDREDBLUE
3121233454
Sheet1
 
Upvote 0
Found my answer, elsewhere - I wasn't using the COUNTIF function correctly.
The correct usage is: =COUNTIF($C$2:C$2,C$2) Copy across.

Just in case anyone else needs it.
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,640
Members
448,974
Latest member
DumbFinanceBro

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