# number sequences

#### musenz

##### New Member
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.

 Sequence Stock Code Contract 1 99998 42 1 1000033 47 2 1000033 50 3 1000033 51 1 1000042 42 2 1000042 45 1 1000070 42

<tbody>
</tbody>

Thanks

### Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
Try this in A2 and filled down, where the stock codes begin in B2

=COUNTIF(B\$2:B2,B2)

Thank you very much.

Replies
7
Views
741
Replies
3
Views
707
Replies
4
Views
125
Replies
6
Views
336
Replies
6
Views
423

Threads
1,206,971
Messages
6,075,925
Members
446,170
Latest member
zzzz02

### 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

### 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