How to add sequence number within groups of repeating values

esprit_y2k

New Member
Joined
Jan 17, 2006
Messages
5
The Problem


SomeColumn
---------
A B C
1 101
2 101
3 102
4 102
5 102
6 102
7 103
8 104
9 104


and you want to apply a sequence number within each group of numbers, starting at 1 again for each instance of a new group, so your resulting data will look like this;


Some Column Sequence
------------------
A B C
1 101 1
2 101 2
3 102 1 )
4 102 2 ) An ascending sequence number is created
5 102 3 ) for each group of numbers e.g. '102'
6 102 4 )
7 103 1
8 104 1
9 104 2

Question.
How do I use a formulae to create the sequence number rather than typing one by one or dragging it down?
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Try this.
Say your numbers are in cell A1 down.
Copy this into another column from Row 1 down
=COUNTIF($A$1:A1,A1)
 
Upvote 1
BrianB,
That is so awesome and yet so simple. I had a similar issue on somethng I was working on.

I am very impressed!
Michael
 
Upvote 0
@BrianB - what a lifesaver! Such a simple formula to get group by sequential numbering. It would've taken multiple lines of SAS code to get this!
 
Upvote 0

Forum statistics

Threads
1,221,499
Messages
6,160,169
Members
451,629
Latest member
MNexcelguy19

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