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
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.

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)
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,163,865
Messages
5,834,066
Members
430,260
Latest member
MANICX100

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