How to assign serial number to duplicate or unique values in Excel?
If you have a list of values which contains some duplicates, is it possible for us to assign sequential number to the duplicate or unique values? It means giving a sequential order for the duplicate values or unique values as following screenshot shown. This article, I will talk about some simple formulas to help you solving this task in Excel.
To order the duplicate values, please apply the following formula:
Enter this formula: =COUNTIF($A$2:A2,A2) into a blank cell beside your data, and then drag the fill handle down to the cells which you want to apply this formula, and the cell values have been assigned based on the duplicate values, see screenshot:
To assign serial number to unique value, the below formula may do you a favor:
Enter this formula: =IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,VLOOKUP(A2,A$1:B1,2,0)) into a blank cell beside your data, and then drag the fill handle down to the cells that you want to apply this formula, and the unique values have been ordered as following screenshot shown:
1. In the above formula, A2 is the cell contain the value you want to assign, B1 is the above cell where your formula located.
2. These formulas also can applied to the values in sorted list, and you will get the following result as you want:
You are guest
or post as a guest, but your post won't be published automatically.
- To post as a guest, your comment is unpublished.· 3 months agoGetting NA result for more than 200 cells
- To post as a guest, your comment is unpublished.· 5 months agoThanks for the formula, my only problem is that I want the generated 'unique identifiers' to be locked/linked to the 'values' but whenever I sort the table, the identifiers always remain in the same spot. Is there a way so that they stay linked to one another?
For example, I am using this code to assign serial numbers to customers, these need to be permanently assigned to one another as they do not change. However, when I sort the table by date, customers or anything at all that re-arranges the data. The serial numbers all get mixed up.
- To post as a guest, your comment is unpublished.· 1 years agoHow to Convert a Cell Containing
A1 = Apple, Orange, Banana, Grapes
A1 = 1. Apple, 2. Orange, 3. Banana, 4. Grapes
- To post as a guest, your comment is unpublished.· 2 years agoHello there,
If i want the formula to have alphabet infront is it possible?
DO223344 = A2
DO223344 = A2
DO567890 = A3
Appreciate if you can assist on my problem.
- To post as a guest, your comment is unpublished.· 2 years agoHi, i want some help, i need my data right this:
I need taht when it finds a new value starts since 1, every time. Is it posible ?
- To post as a guest, your comment is unpublished.· 2 years agoI want serial number start from 1 when it encounter new series
AA - 1
BB - 1
AA - 2
AA - 3
BB - 2
Is this possible?
- To post as a guest, your comment is unpublished.· 2 years agoIs it possible to do this with power query, and not with the vlookup formula?
- To post as a guest, your comment is unpublished.· 3 years agoIs it possible to assign such serial numbers within the same cell? I have a sheet that does this using a macro, but I cannot access the macro (password protected) to see how they did it.
Disclaimer: I have permission to access the macros, but it is an old sheet and the passwords are lost.
- To post as a guest, your comment is unpublished.· 3 years agohai pls help
i have a series of data and i want this type of results
item product sequence number
a powder 1
a juice 2
b preprocess 2
b process 3
b jucie 1
c powder 1
c juice 2
c preprocess 3
c procss 4
want sequence number based on item and product column
- To post as a guest, your comment is unpublished.· 3 years agoCA-01.1
I need to continue this auto-fill in sequential order for hundreds of CA-##s, please help.
- To post as a guest, your comment is unpublished.· 3 years agoI have a series of data and I want to assign every data which repeat more than 6 times in a row with the value zero. How can I do it? plz, help me out?
- To post as a guest, your comment is unpublished.· 3 years ago=if(countif(unique value)>6,0,actual value)
- To post as a guest, your comment is unpublished.· 4 years agoi have this data in sheet1, i work in this sheet on daily basis.
after that i make New Sheet on State Wise Name Like DL, UK, JK, MH etc.
is there any formula who automatic record State entry in State sheet, Like All DL related entry automatic record in DL Sheet.
ID I2 I3 I4 STATE
101 a j 99 DL
102 b k 55 UK
103 c l 44 JK
104 d m 22 MH
105 e n 33 DL
106 f o 77 WB
107 g p 25 DL
- To post as a guest, your comment is unpublished.· 4 years agoHello, tejenndra,
As your problem, may be the Kutools for Excel's Split Data feature can help you. With the Split Data utility , you can quickly split the data from one sheet to others based on column or row.
Take your data for example, after applying the Split Data feature, you will get the following result:
Please let me know if this can help you! Thank you!
- To post as a guest, your comment is unpublished.· 4 years agoI have a column with the same #s listed, but when the formula reaches a duplicate number, it gives an #N/A.
- To post as a guest, your comment is unpublished.· 4 years agoHi, Brandon,
I have tested your example in my workbook, but the formulas work well, can you attach your file or try the formulas again?
- To post as a guest, your comment is unpublished.· 4 years agoin case there are 2 values, i have apply with below formula, but assign unique is going to be error for duplicate value1 & value2, could you pls help advise how to deal with this?
Value1 Value 2 Assign unique
AA 11 1
BB 22 2
AA 11 #N/A
- To post as a guest, your comment is unpublished.· 4 years agoHello,
If you have multiple columns need to use, first, you can combine the columns into a new helper column by using this formula:=A2&" "&B2,and then apply above
formula based on the helper column. you will get the result as you need.
Here is an image example, hope it can help you, thank you!
- To post as a guest, your comment is unpublished.· 1 years agoHi, I need your support,
I have a series of different products sold in different districts. My dataset has duplicate products in all districts and I don't want to remove those duplicate. I want to count unique product in different district in different years. I added one column in EXCEL and I want to put a formula that will rename the product sold in new district for first time to be "NEW" and the continuation of sales of the same product to be renamed "CONTINUING". Which formula I ma supposed to apply in Excel? This is a sample dataset I have; I want the syntax formula in Column "Sales Status"
District: Product Concat (District+Product Sale Status
Iringa A Iringa- A New
Iringa A Iringa- A Continuing
Iringa B Iringa- B New
Morogoro A Morogoro- A New
Morogoro A Morogoro- A Continuing