Number data in a column based on its uniquness

ashyn

New Member
Joined
Nov 19, 2010
Messages
11
Hello Everyone,
I think my question / problem is simple but since i am still learning I need your help.

I have 2 columns (ColA,ColB)
ColA = Random volume of rows with some data which repeats frequently.
ColB= should pick up a sequential number 1,2,3,4 for every new data in ColA.

If a data repeats in ColA then ColB should repeat the same sequence number.

I want to achieve this by putting some formula in ColB instead of Macros.
Is this possible ? If someone can help me learn & find answers.

Example : Example result of how ColB should appear / populate


ColA ColB
Donald 1
Mickey 2
Donald 1
Mickey 2
Jack 3
Thomas 4
Thomas 4
Thomas 4
Mickey 2

Peter Piper 5


So,every time data populates in ColA, ColB should pick up a sequential number. However the same number should repeat if the data repeats in ColA.
"Donald" was the 1st data & it picked up 1 in ColB, now everytime Donald Repeats in ColA ColB= 1

Also, if you notice when there is a New data in ColA = Peter Piper, ColB picked the next sequential number since its new data.

Thanks in Advance for all the support & training.

Regards,
Steeve
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Enter a 1 in B1 then the formula below in B2 and copy it down to your last data point in col A. Note this assumes you have no empty col A cells embedded in your name list.
Excel Workbook
AB
1Donald1
2Mickey2
3Donald1
4Mickey2
5Jack3
6Thomas4
7Thomas4
8Thomas4
9Mickey2
10Peteriper5
Sheet1
 
Upvote 0
Thank you Very much JoeMo. This works perfect & gives exactly the solution. I just copied the formula across all rows I wanted this to calculate & it did perfect. Thank you very much again.. Appreciate It.

Regards,
Steeve



Enter a 1 in B1 then the formula below in B2 and copy it down to your last data point in col A. Note this assumes you have no empty col A cells embedded in your name list.
Sheet1







AB
Donald
Mickey
Donald
Mickey
Jack
Thomas
Thomas
Thomas
Mickey
Peteriper

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:66px;"><col style="width:34px;"></colgroup><tbody>
[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]1[/TD]

[TD="align: right"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]2[/TD]

[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]3[/TD]

[TD="align: right"]1[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]4[/TD]

[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]5[/TD]

[TD="align: right"]3[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]6[/TD]

[TD="align: right"]4[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]7[/TD]

[TD="align: right"]4[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]8[/TD]

[TD="align: right"]4[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]9[/TD]

[TD="align: right"]2[/TD]

[TD="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=cacaca]#cacaca[/URL] , align: center"]10[/TD]

[TD="align: right"]5[/TD]

</tbody>

Spreadsheet Formulas
CellFormula
B2=IF(A2="","",IF(COUNTIF(A$1:A2,A2)=1,MAX(B$1:B1)+1,INDEX(A$1:B1,MATCH(A2,A$1:A1,0),2)))

<tbody>
</tbody>

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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