Count what Instance an Occurance is

TheRogue!

Board Regular
Joined
Mar 2, 2012
Messages
81
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

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.

Scott Huish

MrExcel MVP
Joined
Mar 17, 2004
Messages
19,961
Office Version
  1. 365
Platform
  1. Windows
In A3:
=COUNTIF($A2:A2,A2)

Copy across.

Excel Workbook
ABCDEFGHI
1STANEARLJIMCATHYLIZMURRAYLISAELIPETE
2BLUEBLUEREDREDBLUEREDREDREDBLUE
3121233454
Sheet1
 
Upvote 0

njimack

Well-known Member
Joined
Jun 17, 2005
Messages
7,772
I don't understand why COUNTIF won't suffice?

Excel Workbook
ABCDEFGHI
1STANEARLJIMCATHYLIZMURRAYLISAELIPETE
2BLUEBLUEREDREDBLUEREDREDREDBLUE
3121233454
Sheet1
 
Upvote 0

TheRogue!

Board Regular
Joined
Mar 2, 2012
Messages
81
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,196,017
Messages
6,012,872
Members
441,737
Latest member
bijayche

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
Top