Complex Counting help

Aldonin

New Member
Joined
Jan 27, 2012
Messages
28
Hello there guys!

I have the following list:

B0111531ALSINA EGEA, ESPERANZA
B0111531ALSINA EGEA, ESPERANZA
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC
B0111926PEYPOCH FOCHS, FRANCESC

<tbody>
</tbody>

and I would need to add a number next to each item that is repeated so that it ends up like this:


S562KESLER1
B0111531ALSINA EGEA, ESPERANZA1
B0111531ALSINA EGEA, ESPERANZA2
B0111926PEYPOCH FOCHS, FRANCESC1
B0111926PEYPOCH FOCHS, FRANCESC2
B0111926PEYPOCH FOCHS, FRANCESC3
B0111926PEYPOCH FOCHS, FRANCESC4
B0111926PEYPOCH FOCHS, FRANCESC5
B0111926PEYPOCH FOCHS, FRANCESC6
B0111926PEYPOCH FOCHS, FRANCESC7
B0111926PEYPOCH FOCHS, FRANCESC8
B0111926PEYPOCH FOCHS, FRANCESC9


<tbody>
</tbody>

So basically: for each new item, start counting with "1". If in the next line the item code is repeated then add 1, if its a new item, start again with 1.


I'm sure it will be a piece of cake for some of you, thanks a lot in advance!!
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
assuming the data starts in cell b2 place the following in c2 and copy down:
=IF(B2<>B1,1,C1+1)
 
Upvote 0

Forum statistics

Threads
1,214,945
Messages
6,122,393
Members
449,081
Latest member
JAMES KECULAH

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