number sequences

musenz

New Member
Joined
May 22, 2012
Messages
14
I have a question regarding number sequences and either a macro or a formula.

I have thousands of stock code that can repeat several times due to different contract prices but I want to sequence the number for each time a stock code appears. The stock codes are in order.

Below is an example of what i want to achieve.

SequenceStock CodeContract
19999842
1100003347
2100003350
3100003351
1100004242
2100004245
1100007042

<tbody>
</tbody>

Thanks
 

Some videos you may like

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
Try this in A2 and filled down, where the stock codes begin in B2

=COUNTIF(B$2:B2,B2)
 

Watch MrExcel Video

Forum statistics

Threads
1,122,606
Messages
5,597,134
Members
414,128
Latest member
Jorglo

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