QuestionsAnswered.net
What's Your Question?

Why Do Companies Use Serial Numbers?
Many products you have in your home have unique serial numbers printed on them. Companies assign serial numbers to their products. If you ever have to contact a company regarding a product, one of the first things you’ll need to do is provide the serial number of the item.
What’s a Serial Number
A serial number is a unique string of numbers and letters assigned to a product or item. You could compare a serial number to a fingerprint, in that each number is uniquely tied to a specific item to identify it. Depending on the item, a serial number might be stamped onto a product sticker, engraved into metal or embedded into an electronic device. Serial numbers can even be connected to the purchaser, in the case of software programs.
How Serial Numbers Are Created
It’s possible to use tools or programs to generate serial numbers. These tools create random codes in batches, which can then be assigned to products. With the assignment of serial numbers, it’s necessary to record each assignment to track the products. Then, the serial numbers will enable management of inventory or products that are sold.
Typical Uses of Serial Numbers
Manufacturers use serial numbers to track merchandise, often for quality control purposes. Serial numbers can make it possible to recall products when necessary. The manufacturer would publish a list of serial numbers, possibly also contacting purchasers if contact information is kept on file.
Serial numbers connected to software enable manufacturers to limit the number of installations performed for each product. Installation of the software registers it with the manufacturer, who can then block any further installations from occurring.
Serial numbers are also useful for managing warranties. After purchase, manufacturers will require that consumers register products by providing serial numbers. Then, if a consumer wants to initiate a warranty request, it will be necessary to provide the date of purchase and serial number.
Internal Use of Serial Numbers
Internally, a company can use serial numbers to manage inventory. When tools or equipment are used, the company can identify and track when and where the equipment is used to make sure it is returned to storage.
Tips for Finding Serial Numbers
Locating a serial number can be challenging. If you have an appliance or a hardware device, look on the bottom or back of the item. You’ll usually find a sticker with the model number and serial number printed on it. Sometimes serial numbers are engraved in metal too. For software installed with a CD, look on the CD case or in the packaging to find the serial number. Sometimes serial numbers are also embedded in the product information of the software.
MORE FROM QUESTIONSANSWERED.NET

- Coding Ground
- Corporate Training
- Trending Categories

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
How to Assign a Serial Number to Duplicate or Unique Values in Excel?
Let us assume we have collected the data from a public source and you want to add the ID to each result. To do that, first we need to know how many unique items are present in the sheet. This tutorial will help you understand how you can assign a serial number to duplicate or unique values in Excel. Here we will have two parts. The first part is about assigning serial numbers to unique values, and the next part is about assigning serial numbers to duplicate values.
Assigning a Serial Number to Duplicate Values in Excel
Here we will first use the COUNTIF formula and then fill in all the results to get our final output. Let us see a simple process to assign serial numbers to duplicate values.
Let us assume we have an Excel sheet where the data is similar to the data shown in the below image.

To assign the serial number to duplicates, click an empty cell; in our case, it will be B2, and enter the formula =COUNTIF( $ A $ 2:A2,A2) in the formula box, then click on Enter to get the first result as shown in the below image.

We have assigned one to the first value. Now to fill the serial drag down using the autofill handle.

Assign a Serial Number to Unique Values in Excel
Here we will first use the formula to get our final result. Let us see a simple process to assign a serial number to unique values in Excel.
Let us consider the same data that we used in the above example.
To assign serial numbers to unique values, click on an empty cell, in our case cell B2, and enter the formula =IF(COUNTIF(A $ 2:A2,A2)=1,MAX(B $ 1:B1)+1,VLOOKUP(A2,A $ 1:B1,2,0)) in the formula box. Click on Enter to get the first result as shown in the below image.

We can successfully assign number to first value. Then drag down from the first result till all the results are printed, and our final output will look similar to the below image.

In this tutorial, we used a simple example to demonstrate how we can assign a serial number to duplicate or unique values in Excel to highlight a particular set of data.

0 Followers
- Related Articles
- How to Add a Unique ID Number Column for Duplicate Rows in Excel?
- How to Assign a Value or Category Based on a Number Range in Excel?
- How to Calculate or Assign Letter Grade in Excel
- Assign value to unique number in list in Python
- MySQL UNIQUE declaration to avoid inserting duplicate values?
- How to Assign a Hotkey to a Specified Macro in Excel?
- How to assign values to variables in C#?
- How to assign values to variables in Python
- How To Check Whether a Number is a Unique Number or Not in Java?
- How to change or convert number to text in Excel?
- How to change or convert text to number in Excel?
- Assign ids to each unique value in a Python list
- How to assign multiple values to a same variable in Python?
- How to get programmatically android serial number?
- How to Auto-Number or Renumber after Filter in Excel?

- Kutools for Excel
- Kutools for Word
- Kutools for Outlook
- How to Install or Uninstall
- End User License Agreement
- Tips & Tricks for Excel
- Tips & Tricks for Word
- Tips & Tricks for Outlook
- Excel Functions
- Excel Formulas
- Excel Charts
- Outlook Tutorials
- Search Search more
- About Us Our Team
- User Testimonials Users Say
- Retrieve License Lost License?
- Report a Bug Bug Report
- Forum Post in Forum
- Contact Us Talk to us via email
- Forgot Username?
- Forgot Password?

- Outlook Tips
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.

Assign serial number to duplicate values with Formula
Assign serial number to unique value with formula.
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:

The Best Office Productivity Tools
Kutools for excel solves most of your problems, and increases your productivity by 80%.
- Reuse : Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
- Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range ...
- Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns ... Prevent Duplicate Cells; Compare Ranges ...
- Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
- Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets , Check Boxes and more...
- Extract Text , Add Text, Remove by Position, Remove Space ; Create and Print Paging Subtotals; Convert Between Cells Content and Comments ...
- Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
- Combine Workbooks and WorkSheets ; Merge Tables based on key columns; Split Data into Multiple Sheets ; Batch Convert xls, xlsx and PDF ...
- Pivot Table Grouping by week number, day of week and more... Show Unlocked, Locked Cells by different colors; Highlight Cells That Have Formula/Name ...
- More than 300 powerful features . Supports Office / Excel 2007-2021 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial. 60-day money back guarantee.
Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier
- Enable tabbed editing and reading in Word, Excel, PowerPoint , Publisher, Access, Visio and Project.
- Open and create multiple documents in new tabs of the same window, rather than in new windows.
- Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!


- Forgotten Your Password?

- Today's Posts
- Mark Forums Read
- Quick Links :
- What's New?
- Members List
Forum Rules
- Commercial Services
- Advanced Search

- Microsoft Office Application Help - Excel Help forum
- Excel Formulas & Functions
Assign sequential numbers to unique values in a list
Thread tools.
- Show Printable Version
- Subscribe to this Thread…
Rate This Thread
- Current Rating
- Excellent
- Average
- Terrible
- Linear Mode
- Switch to Hybrid Mode
- Switch to Threaded Mode

Hi, Please can you help me assign a sequential number to each new value in an unsorted list, and where duplicates occur, assign the same number as the duplicate E.g. A 1 B 2 C 3 D 4 A 1 C 3 E 5 Thank you

Re: Assign sequential numbers to unique values in a list
Assuming your data starts in A2, (leaving a row above), then in B2 enter: =IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,VLOOKUP(A2,A$1:B1,2,0)) copied down.
Where there is a will there are many ways. If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

What about assigning unique values with multiple criteria, for instance: aa 1 ab 2 aa 1 ba 1 bb 2 bc 3 ca 1 ca 1 cb 2 cc 3 I am assigning unique values for each of the subsets (first letter is a, b, c). I am able to separate out the two parts in the first column like this: a a 1 a b 2 a a 1 b a 1 b b 2 b c 3 c a 1 c a 1 c b 2 c c 3
I found the answer to my question. I was able to do it with the array formula as follows: {=IF(COUNTIFS(A2:A$2,A2,B2:B$2,B2)>1,VLOOKUP(C2,C1:D$1,2,0),MAX(IF(A1:A$1=A2,D1:D$1)+1))} Where column A is the first set, column B is a set within each subset in column A, column C is column A values concatenated with column B, and column D is the unique value within each subset of column A generated by the array formula. Remember to copy the array formula without the brackets around it and commit the array formula to the cell with CTRL+Shift+Enter. a a aa 1 a b ab 2 a a aa 1 b a ba 1 b b bb 2 b c bc 3 c a ca 1 c a ca 1 c b cb 2 c c cc 3 c b cb 2 a c ac 3 a b ab 2 a a aa 1 a a aa 1 a b ab 2 a a aa 1 b a ba 1 b b bb 2 b c bc 3 c a ca 1 c a ca 1 c b cb 2 c c cc 3 c b cb 2 a c ac 3 a b ab 2 a a aa 1

I want to achieve a similar objective, but when I insert the formula, it will not insert a number to a respective duplicate value. After inserting the formula =if(COUNTIF(H$2:H2,H2)=1,MAX(I$1:I1)+1,VLOOKUP(H2,H$1:I1,0,FALSE)) It returns: H ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I Heat# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (Blank) HT 414... Unique~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 HT D07... Unique~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 2 HT C21... Unique~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 HT 414... Duplicate of first Unique Value~~~~~~~~~~~~~~~~ (Blank) HT 234... Unique~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 4 My question is how do I get the duplicates to show the value given to the original unique value so that, in this example, the second and subsequent HT 414... will show 1 and so on for all possible duplicates. For instance, if HT C21 reappears, the adjacent cell will return "3" Thank you in advance.

jmshanahan welcome to the forum Unfortunately your post does not comply with Rule 2 of our Forum RULES . Do not post a question in the thread of another member -- start your own thread. If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread. Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
1. Use code tags for VBA. [code] Your Code [/code] (or use the # button) 2. If your question is resolved, mark it SOLVED using the thread tools 3. Click on the star if you think someone helped you Regards Ford
My apologies, I made a new thread.

Thank you this thread has proven to be useful. How can the formula that was provided to the OP be modified to ignore '0' as a unique entry? =IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,VLOOKUP(A2,A$1:B1,2,0)) A 1 B 2 C 3 D 4 A 1 C 3 E 5 0 Blank/Nil 0 Blank/Nil 0 Blank/Nil 0 Blank/Nil (or just resolve to 0) The reason I am asking is because my field is populated from another sheet using the =INDIRECT("Sheet!A1") which resolves 0 until the referenced cell is populated. I know it's one question per thread but I think this is related closely enough?
Cottonbaler welcome to the forum Perhaps you missed my post #6 a little above your post? Unfortunately your post does not comply with Rule 2 of our Forum RULES . Do not post a question in the thread of another member -- start your own thread. If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread. Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.
Thread Information
Users browsing this thread.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
- BB code is On
- Smilies are On
- [IMG] code is Off
- HTML code is Off
- Trackbacks are Off
- Pingbacks are Off
- Refbacks are Off
- ExcelForum.com

Avoid Duplication in Serial Numbers in Excel
- -- By Sumit Bansal
A friend called me and asked if there is a way to have serial numbers in such a way that they are no duplication in serial numbers in Excel.
Something as shown below:

He wanted that the serial number for India should be 1 wherever it occurs. Similarly, US is the 2nd country and should always have 2 as its serial number.
This got me thinking.
And here are the two ways that I could come up with to avoid duplication in serial numbers in Excel.
Method #1 – Using VLOOKUP Function
The first way is to use our beloved VLOOKUP function .
To do this, we first need to get a unique list of countries. Here are the steps to do that:
- Create a copy of the list of countries (copy paste it in the same worksheet or another worksheet).

- That’s it. You will have a list of unique country names.

In the cell, where you want the serial numbers (B3:B15), use the below VLOOKUP formula:
=VLOOKUP(C3,$F$3:$G$8,2,0)
This VLOOKUP formula takes the country name as the lookup value, checks for it in the data in F3:G8, and returns its serial number.
Method #2 – A Dynamic Formula
While the VLOOKUP method is a perfectly fine way of doing this, it is not dynamic.
So if I add a new country or change an existing country, this method would not work and you will have to repeat the entire process of method #1 again.
Here is a formula that makes it dynamic:
=IF( COUNTIF ($C$3:$C4,$C4)=1, MAX ($B$3:$B3)+1, INDEX ($B$3:$C$ 18, MATCH ($C4,$C$3:$C4,0),1))
To use this formula, you need to manually enter 1 in the first cell, and the above formula in all the other remaining cells.
How it work s:
It uses an IF function that checks the number of times a country has occurred prior to that row. If the country name occurs for the first time, the count is 1 and the condition is TRUE, and if the country name has occurred earlier as well, the count is more than 1 and the condition is FALSE.
- When the condition is TRUE:
=MAX($B$3:$B3)+1
If the value is TRUE, which means that the country name is appearing for the first time, it identifies the maximum value of serial number till then and adds 1 to it to give the next serial number value.
- When Value if FALSE:
=INDEX($B$3:$C$18,MATCH($C4,$C$ 3:$C4,0),1)
If the country has already occurred earlier, this formula goes to the cell where it appears first and returns the serial number of the first occurrence of that country.

You May Also Like the Following Excel Tutorials:
- How to Use Flash Fill in Excel.
- Automatically Sort Data in Alphabetical Order using Formula .
- How to Quickly Fill Numbers in Cells without Dragging .
- How to use Fill Handle in Excel .

FREE EXCEL BOOK
Get 51 Excel Tips Ebook to skyrocket your productivity and get work done faster
2 thoughts on “avoid duplication in serial numbers in excel”.
Need a serial number
I need a serial number
Comments are closed.
BEST EXCEL TUTORIALS
Best Excel Shortcuts
Conditional Formatting
Creating a Pivot Table
Excel Tables
INDEX- MATCH Combo
Creating a Drop Down List
Recording a Macro
© TrumpExcel.com – Free Online Excel Training

Privacy Policy | Sitemap
programming talks
Let's talk codes..
How to assign serial number to duplicate or unique values in Excel?
Assign serial number to duplicate values with formula.
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:

Assign serial number to unique value with Formula
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:

Share this:
Leave a reply cancel reply.
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Notify me of new posts via email.

- Already have a WordPress.com account? Log in now.
- Follow Following
- Copy shortlink
- Report this content
- View post in Reader
- Manage subscriptions
- Collapse this bar

- Search forums
- If you would like to post, please check out the MrExcel Message Board FAQ and register here . If you forgot your password, you can reset your password .
- Question Forums
- Excel Questions
How to Assign Serial Number to Unique Values with Condition in Excel
- Thread starter rengifot
- Start date Jan 5, 2021
- Jan 5, 2021
Excel Facts
Candyman8019, well-known member.
What is the desired format of your unique serial number? Assuming if column A, B and D are duplicated then the serial number will also be duplicated?
Candyman8019 said: What is the desired format of your unique serial number? Assuming if column A, B and D are duplicated then the serial number will also be duplicated? Click to expand...
- Jan 6, 2021
The above is assuming the list is sorted by column A, then Column B.
Thank you very much Candyman8019! The formula worked perfectly for my 50K records! I really appreciate your assistance and expertise.

Similar threads
- Carl_upnorth
- Feb 24, 2023
- Feb 13, 2023
- Feb 20, 2023

- freshgoblinmilk
- Nov 7, 2022
- Nov 24, 2022

Forum statistics
Share this page.

We've detected that you are using an adblocker.
Which adblocker are you using.

Disable AdBlock

Disable AdBlock Plus

Disable uBlock Origin

Disable uBlock


Excel assign sequence number to duplicate records
This Excel tutorial explains how to assign sequence number to duplicate records using COUNTIF Function.
You may also want to read:
Excel check duplicate values using Conditional Formatting
Excel delete duplicated data in consecutive rows
Suppose you have two sales transactions on the same date but you don’t have any transaction timestamp (but records are in ascending order of time), you may want to add a number to each transaction so that you can easily identify and filter the first transaction, 2nd transaction, etc. Assigning sequence number can also facilitate to use SQL to select the record using Min and Max; otherwise it is easy to create Cartesian Product.
Let’s say we have the below transaction dates. Note that Jan 1st is repeated at the bottom.
In Cell B2, type formula =COUNTIF($A$2:A2,A2)
Autofill down the column, then you will get a sequence number for each transaction.
That means if you have one transaction on a date, you will always get sequence number 1. If you have two transactions on the same date, the first record is assigned sequence number 1, then second record gets number 2 and so on. Therefore Jan 1st 2017 in row 1 is assigned sequence number 1 because it comes first in the data set, then row 14 is assigned sequence number 2.
Assign sequence number to duplicate records – Excel VBA
While it is good enough to follow the above non-VBA solution, you can also go for a Macro solution which uses the same COUNTIF formula.
Press ALT+F11, copy and paste the below code in a new Module.
Run the Macro to get the same result without seeing the formula.
Leave a Reply Cancel reply
Your email address will not be published. Required fields are marked *
Save my name, email, and website in this browser for the next time I comment.

How to Automatically Add Serial Numbers in Excel
Experts know the importance of serial numbers. Serial numbers are like salt. You never feel their presence but their absence makes your data tasteless.
Yes, they are important.
Because with a serial number you can have a unique identity to each entry of your data.
But the sad news is, adding them manually is a pain. It’s really hard to add a number in every row one after another.
The good news is, there are some ways which we can use to automatically add serial numbers in a column.
14 Ways to Insert Serial Number Column in Excel
And today, in this post, I’d like to share with you 14-Quick Methods . You can use any of these methods which you think is perfect for you.
These methods can generate numbers up to a specific number or can add a running column of numbers. Choose one of the below methods as per your need and if you think you have a way, then please share it with me in the comment section.
Row Numbers as Serial Numbers
By default, in a spreadsheet, you have row numbers which act as a serial number for the data.
If you don’t want to use serial numbers for filtering or any other purpose then it’s better to use the row headers.
Otherwise, follow ahead mention methods to create a separate column of serial numbers.
Use Fill Handle to Add Serial Numbers
To simply add serial numbers using fill handle you can use the following steps.
- Enter 1 in a cell and 2 in the next cell downward.
- Select both the cells and drag down with fill handle (a small dark box at the right bottom of your selection) up to the cell where you want the last serial number.
- Once you get serial numbers up to you want, just release your mouse from the selection.
Quick Note : This is not a dynamic method, you have to insert serial numbers again when you update your data.
Inserting 1 and 2 in the cells is a must. If you try to drag by using only 1, it will start to repeat 1 in all cells.
Method #3 (Fastest)
Fill series to automatically add serial numbers.
Now let’s say you want to automatically number rows up to 10000 or 100000 and you want to do this in a one go.
Maybe it’s a pain with fill handle but, you can use fill series to generate a column with serial numbers in a one go.
Here are the steps.
- Select the cell from where you want to start your serial numbers and insert “1” in it.
- Now, go to home tab ➜ editing ➜ fill ➜ series.
- Series In = Column.
- Step Value = 1
- Stop Value = 10000 or whatever you want up to.
The best part of this method is it works like a serial number generator and you can use it even if you want up to one million.
Quick Note: This method is also not dynamic. If you want to extend the list, you need to insert serial numbers again.
Use ROW Function to Drag Serial Numbers
ROW is an effective way to insert serial numbers in your worksheet.
It can return the row number of a reference and when you skip referring to any cell it will return the row number of cell in which you have entered it.
Here's the simple steps.
- Go to cell A1, edit it and enter the =ROW() formula in it.
- Now drag the formula to down , up to the serial number you want.
Quick Note: If you are not starting your serial numbers from row 1, you have to add the count of rows in the formula which you have skipped.
It has a benefit over other methods that it works even when you sort your data.
Method #5 (My Favorite ?)
Generate serial numbers by adding one in the previous number.
This is my favorite method and believes me, it's lightning fast.
Follow these steps
- Enter 1 in the cell from where you want to start your serial numbers.
- In next down cell, enter formula =G1+1 (G1 is the starting cell here).
- Drag this formula to down, up to the serial numbers you want.
Quick Note: It will create an incremental number by adding 1 to the previous number.
It is also a dynamic method, you just have to drag the formula when you want to add a new serial number.
Get Serial Numbers with COUNTA Function
Using COUNTA is a nice way to add serial numbers to your data. By using it you can actually count your data entries and give them a number.
Follow these simple steps.
- Enter the following formula in the cell from where you want to start your serial numbers. (For example, your first data entry is starting from F1, enter below formula in E1).
= COUNTA (F$1:F1)
- Drag down the formula up to the serial number your want.
Quick Note: This also a dynamic method to add serial numbers.
The benefit of this method is, it will return blank if you have any blank row in your data.
Add Roman Numbers as Serial Numbers
And, if you want to add roman numbers as serial numbers. You can use the roman function with ROW.
Follow these simple steps:
- Enter the following formula in the cell from where you want to start.
= ROMAN ( ROW ())
- Drag down the formula up to the serial number you want.
Method #8 (VBA Code)
Add serial numbers with a vba code.
This macro code can be useful if you want to create a series of numbers without using formulas.
Sub AddSerialNumbers()
Dim i As Integer
On Error GoTo Last
i = InputBox("Enter Value", "Enter Serial Numbers")
For i = 1 To i
ActiveCell.Value = i
ActiveCell.Offset(1, 0).Activate
Check this out: Top 100 Useful Excel Macro [VBA] Codes Examples
If you want to add every serial number twice, then you can use below code for that.
Dynamic Serial Numbers for Filters
Let’s say you have serial numbers in a data table and when you filter some specific data from it show you actual serials.
But, if you use a dynamic method to insert serial numbers then you can get double benefits.
First , whenever you filter data it’ll show you serial number according to the filtered item.
Second , if you want to paste that filtered data to somewhere else, you don’t have to insert them again.
For this, you can use SUBTOTAL function and the formula will be like below.
=SUBTOTAL(3,B$2:B2)
After that, drag this formula up to the last cell of the table. Now. whenever you filter data you’ll dynamic serial number.
Quick Note: If you copy data from a table where you have dynamic serial numbers and then paste those numbers to any other place. The formula which you have used for the numbers will work in the same way.
Serial Numbers in a Table
The best way to automate your serial numbers is by using a table for your data. When you add a new entry, table automatically drag-down formula into the new cell.
You just need to insert a formula in first two one or two entries, after that, you’ll get it automatically.
In the below table when you enter a new entry in a new serial number automatically generates.
Incremental Serial Number by Multiplying
In the comment section, Vikas asked me to add serial numbers which number should be increased by multiple of 3.
A simple solution is to enter 1 in the first cell and then multiply it with 3 and drag the formula below.
Method #12 (For Pivot Table Lovers)
Serial numbers in a pivot table.
To add serial numbers to a pivot table you need to add an extra column in the source data.
And one more point which you need to understand that this number column will be placed after row item columns, just like below.
For this, please follow the below steps:
- First of all, add a new column in your source data with 1 in each cell.
- Next, create a pivot table with that data.
- After that, add that column as values.
- Now, right click on that column on values section and open “Value Field Settings”.
- From here go to “Show Values As” tab and select running total in and then click OK.
Now you have a new column in your pivot table with staring from one to the maximum row .
Quick Note: This is a dynamic column and when you filter pivot numbers will change automatically.
Add a Serial Dates in a Column
Now, let me show you something different. Imagine you want to enter serial wise dates in a column, you have two different methods for this.
First is, you can add starting date in a cell and then in the next cell downward refer to the above cell and add “1” into it.
As you know Excel stores dates as numbers and every date has a unique number.
So, when you add “1” in a date it will return the next date in the result.
The second method is quite simple.
Just enter the starting date into a cell and then use the fill handle to extend it to the desired date.
Just like serial numbers, you will get a sequence of dates in the column.
Quick Note: If you want to insert dates only for one time then the second method is perfect, but if you going to expand them frequently then go with the first one.
Convert Serial Numbers to Serial Dates
If you already have serial numbers in your worksheet and you want to convert them to serial dates then you can simply do that with the following formula.
Please note, with this method, you are using the serial number as a day and then you create a date.
Let’s say you have serial numbers starting from A1, then in cell B1, add below formula.
=DATE(2017,1,A1)
After that, drag-down it up to the last serial number cell and you’ll get a sequence of dates.
Quick Note : Once you convert these numbers into dates then you can use method 10 to insert serial dates further.
If you have data whether small or large it is must to add serial numbers to it. The one thing which you really need to understand that a serial number give a unique identity to each entry.
And, with all the methods you have learned above it’s no big deal to create a serial number column in the data, no matter which situation you are in.
I hope you found this useful, but now, tell me one thing.
Which method do you prefer to insert serial numbers?
Please share your views with me in the comment section. I'd love to hear from you and please don’t forget to share it with your friends, I am sure they will appreciate it.
More Tutorials
- Convert Negative Number into Positive in Excel
- Insert (Type) Degree Symbol in Excel
- Convert a Formula to Value in Excel
- Insert a Timestamp in Excel
- Insert Bullet Points in Excel
- Insert an Arrow in a Cell in Excel
- Insert Delta Symbol in Excel in a Cell
This tutorial is a part of our Basic Excel Skills , and if you want to sharpen your existing Excel Skills, checkout these Excel Tips and Tricks .
About the Author
Puneet is using Excel since his college days. He helped thousands of people to understand the power of the spreadsheets and learn Microsoft Excel. You can find him online, tweeting about Excel, on a running track, or sometimes hiking up a mountain.
59 thoughts on “How to Automatically Add Serial Numbers in Excel”
There is no formula in Method 10
Thank you so much! Your fave is so efficient and I used that.
Need a unique and absolute value for each new entry (column of data) as I create it – none of these seem to stick to the data when resorting (thus not a serial number) or I am not getting it.
What I want is a blank or null field, and as I enter data into a new column, the field autopopulates with a unique (preferable sequential) number
I feel like I must be missing something here… thanks
Method #12 (For Pivot Table Lovers) Hi, To the above method it gives serial correctly when it is a non filtered Pivot, what if I sort my Pivot value field to get my Dr+ and Cr- and there are Zero Pivot results at Value Field. which I need to ignore with manual filter out !, ie. I will apply a filter to Pivot Value Area and Remove my Values with Zero results Manually, such as -0.00,0.00, which will give me absolute list or +/- values, however what I am seeking is to have the series (calculated Field) should apply to only visible cells only, This works when I use Aggregate function outside the Pivot ! seek to maintain the same result at Pivot? any thoughts. Please seek your assistance urgently. Thank you in advance.
hi thanks for the ways in which sr no can be added but, unfortunately cant find a way that helps me. so posting to see if something can be done… so i need serial no in coloumn A of csv file and in Coloumn B have previous serial no (old ones) and as same data is repeated in 3-4 rows hence has the same serial no so is there a way that new serial no can detect same data in coloumn B and based upon that give serial no…
In Column A… =IF($B2<=$B1,"",MAX($A$1:A2)+1) If your Col B serial is repeated, Statement is true and "" is given. If Col B advances in series, statement is false and Col A will find the max value of the Column thus far (the last number in series) and and 1 to it.
I have tried in MS Excel 2007, but it is not working
can you plese give the formula/code for method #10
I followed your method number 2. But to add to it, it showed 2 in all the rows with a drop down option at the end showing autofill options in which I then clicked on one of the options of fill series. That did the trick.
Need some excell solve 1.search on textbox then show data in listbox According to textbox search value And when clicked on listbox item data come to Textboxes.value i already done it
2.now need data update from textboxes value To sheet specific range based on textbox search Value
3.at the time of adding data in sheet i want row By row data insert from form textbox billno date Partyname will have onetime but item qty rate Will have 6 or 7 or 8 item. When item insert row by Row bill date partyname should insert automatically Row by row solve it. 4.at the time of update bring data on user form Textbox by trxtbox search then update in sheet.
I all done it using module linking with sheet I have done all by anotherway .now need using Form based.
Wanting to make list that will attach a new serial number to a persons name and building type(portable building bought) if I type it in. Also if I need to search for that person or serial number after it gets assigned will the Excel be able to go back and find it?
HOW TO PUT NEXT SERIAL NUMBER WHEN DATA REPETITION ENDS FILTERED TABLE COLUMN, FOR EXAMPLE BELOW
SR. DATA (FILTERED:SCHOOL+COLLEGE) [UNIVERSITY DE-SELECTED] 1 SCHOOL 1 SCHOOL 2 COLLEGE 2 COLLEGE ………..>
I find the links to your 14 methods to be inactive..?
However, I hope you can help me;
I am looking for a way to auto add serial numbers in a column when a new row is inserted at the bottom of a table, but the serial numbers should filter with the records if I run a sort on another column..?
Thus, the serial number “marries” the record and move along with it when I run a sort.
So, when I run a sort on the serial number column afterwards, the table restores to its original form.
It works if the serial numbers are entered manually, thus fixed (not determined by formulas in the cells), but I need it to autofill when a new row is inserted at the bottom of the table..?
Will appreciate so much!!
this can be done with VBA and Excel Table
Dear Puneet, I just came accross your site, Indeed its informative, however I am looking for one of the solution/ the way to insert serial no at column based to Random input on multiple criteria at row/column cells Exampls, I am trying to maintain a Voucher Series with Alpha numeric as Sr.No. based on the date sequence, my row “Date” input for particular transaction might change any any given point, suppose row2,3,4/Catagory X has Date as 1-Jan-2020, than my sequence for voucher Sr will be 1,2,3, but if I change row4 Date input to 1-Dec-2020 by keeping the same catagory as X than my Voucher should have Sr. as 1 as my date is older then row 2,3 based to catagory. if catagory input criteria changed Z then it will be 1 only, same way if I change row 3 catagory as Z than keeping same date (1-Jan-20),than Voucher no should be 2 Hopefully you understand on what is desired. Please to know me on my email
Voucher Sr, Catagory, Date, 1 X 1-Jan-2020 2 X 1-Jan-2020 3 (2) X (Z) 1-Jan-2020 4 (1) Z 1-Dec-2020
Thank you in advance Best Regards.
I want to create serial number automatically, but they should then remain as absolute values and should not change, if i add or sort data in table. How to do that
I’m using spreadsheet to work on students results and their age simultaneously with my phone, coz I don’t have desktop computer. But the problem I’m encountering right now is the arrangement of serial numbers and date of birth. Like for instance, from numbers 1 to 73 is not in the same line with numbers 74 to 112. Numbers 1 to 73 is at the normal column, while numbers 74 to 112 is at the side of the column. Lastly, students which their date of birth is from 10 – 31. Like for example; 10 – 02 – 2007 will be at the normal column. But students which their date of birth are below 10 will be at the side of the column. For example; 09 – 02 – 2007. Please how can I arrange it in line properly. Thanks in anticipation.
It would be great if you share a snapshot with me -> puneet(at)excelchamps(dot)com
Sir Good morning..
Sir im not from vba background but I need to know we can make a booking calander via vba code in userform where I can show stay length in room with guest name..
Please help..
I’m searching this question’s answer from a long days back..
I want month wise serial no.in every click from dropdown list. either from sheet 1 or from sheet 2 sequence of sr.no.not to change.please explain..
THANK YOU VERY MUCH, I WOULD HAVE RENUMBER 1K CONTENTS.
THANK U SO MUCH
Totally not what I was looking for. I have a single excel file. I have a field at the top “work order number”. Each time I open the file and do a “save as”, I want it to increment. How do I do that?
how to insert 4 columns in between sl.no. 1 to 800 for example sl.no.1 4 empty columns, sl.no.2 4 empty columns, sl.no.3 4 empty columns, this through out the 800 sl.nos
i want to put serial no as below data in automatic (colon A having s/n, B having group data but i need sn in group data wise 1 HS Code 24031100 24031100 24031100 2 HS Code 22 02 99 90 3 HS Code 24031920 24031920 24031920 4 HS Code 24022010
5 HS Code 24021000 24021000 24021000
Dynamic Serial Number method good find. Also Learnt usage of Row and CountA function in Serial number from this. Thank you 🙂
Thanks a lot for your explanations! it really helped me..I personally like method 3 and 5.
What formula will be use for this type of numbring
S.N. QUALITY 1 2/60 ERI 1 10 S SLUB COTT 1 25S ACRLYIC
2 2/60 ERI 2 2/20 COT 2 10 COTTON 2 2/40 COTTON
3 2/60 ERI 3 2/20 COT 3 10 COTTON 3 2/40 COTTON
4 2/20 COTTON 4 2/60 ERI 4 25 S ACRLYIC
did you get an answer in regards to this?
I am not clear with your Method #10. can you explain clearly?
I have a serial numbers as A,B,C,D,…Z. If I delete one of the row, the series of A,B,C,D,E…Z should not be changed. it should again shows A,B,C,D,E,…..Z. please help…its urgent.
I WANT TO ADD SR NUMBERS AS 1(18-19) AND THAN 2(18-19) IN A COLUMN BUT BECAUSE OF () I AM NOT ABLE TO ADD SERIAL NUMBERS PLS HELP
You need to use ROW function and then add (18-19) as a test so if I have to insert serial number in cell A1 then the formula would be =ROW()&”(18-19)”
How to add Serial no. having figure more than 15 digits, like 89080068770002819
Give me a better example. what do you mean by 15 digits? 🙂
what the formula for method 10
awesome work !
I often use MAX to achieve automated numbering, with cell formatted as a number ending in decimal point (“#,##0.”), with a dependency on the cell to the right having a value in it.
For example With Row 1 having column headings, I would have the following formula in call A2 – =if( $B2 = “” , “” , max( $A$1:$A1) + 1 which can then be dragged / copied down to the bottom of the sheet or area you need it to apply to. Useful to apply step by step documentation of steps in a process, where blank lines between any steps do not get numbered.
I need to insert automatic serial no.s like : TK001 TK002 TK003 ….and so on. with condition that when there is some entry in the next coloum even then this serial no. has auto entered.
DID YOU GOT IT ? I AM SEARCHING FOR THE SAME
i want to get a series like 1,1,2,2,3,3,4,4,5,5,.. and so on. How to do that?
i = InputBox(“Enter Value”, “Enter Serial Numbers”)
For i = 1 To i ActiveCell.Value = i ActiveCell.Offset(1, 0).Activate ActiveCell.Value = i ActiveCell.Offset(1, 0).Activate Next i
Let’s say your sequence begins in cell A2. In cell A2, enter a 1 In cell A3, enter this formula: =IF(COUNTIF($A$2:A2,A2)=1,A2,A2+1) Use the fill handle to drag that down as far as needed.
Please help To get serial chace
How to do that please help
hii i want to make auto fill column like 3 9 27 81
Multiply with three and drag down.
Its owesome Yaar
Thanks for your words. 🙂
I often use COUNTA(A$1:A1) to add serial number.for filering i’d love SUBTOTAL(3,B$1:B1)
Thanks for sharing.
The other day I learned the following: – in Cell A1 type the number 1 – while holding down CTRL button, use Fill Handle on bottom right hand corner of cell A1 and drag down – you will see the numbers filled in sequential order as you drag down
Thanks Derek
Well, this is my favorite as it works with filtering: =subtotal(3,a$1:a1)
Do I miss something here? I have put the subtotal function in A1 and copied it down. What I get is 0 (zero) in all my cells. I use the norwegian version and the 3 points to COUNTA, is that correct?
formula should be =SUBTOTAL(3,B$1:B1)
Leave a Comment Cancel reply

IMAGES
VIDEO
COMMENTS
To find the value of a piano with a serial number, use the number to determine the approximate date the piano was made. Match the serial number to a manufacturer using a list of numbers and brands, such as the one available on UKPianos.co.u...
Many products you have in your home have unique serial numbers printed on them. Companies assign serial numbers to their products. If you ever have to contact a company regarding a product, one of the first things you’ll need to do is provi...
Researching the artist and the artwork online, in auction house catalogs and through online auction sites is the most direct way to determine value, as is getting an appraisal of the piece.
To assign serial numbers to unique values, click on an empty cell, in our case cell B2, and enter the formula =IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:
Notes: 1. In the above formula, A2 is the cell contain the value you want to assign
The video offers a short tutorial on how to assign serial numbers to unique values in Excel.
The video offers a short tutorial on how to assign serial numbers to duplicate values in Excel.
Unregistered Fast answers need clear examples. Post a small Excel sheet (not a picture) showing realistic & representative sample data WITHOUT
Method #1 – Using VLOOKUP Function · Select the copied data and go to Data –> Remove Duplicates. It will open the remove duplicate dialogue box. · Make sure that
arrow blue right bubble Assign serial number to unique value with Formula ... Notes: 1. In the above formula, A2 is the cell contain the value you
Column D is just a reference of what I should get with a formula and it is not part of the criteria. For example for the ACNE~ISOTRETINOIN
Mar 30, 2021 - How to assign serial number to duplicate or unique values in Excel?
While it is good enough to follow the above non-VBA solution, you can also go for a Macro solution
14 Ways to Insert Serial Number Column in Excel · Row Numbers as Serial Numbers · Use Fill Handle to Add Serial Numbers · Fill Series To Automatically Add Serial