Note: The other languages of the website are Google-translated. Back to English

How to add unique id number column for duplicate rows in Excel?

Supposing there are some duplicate data in a column, now you want to add unique ID number for these duplicate rows as below screenshot shown, do you have any good ways to add them? Here, I introduce a formula to help you quickly handle this job in Excel.
doc unique id number to duplicate rows 1

Adding unique ID number column for duplicate rows with a formula

Adding missing ID number with Kutools for Excelgood idea3

Adding unique ID number column for duplicate rows with a formula

To add unique ID number for duplicate data, you can do as these steps:

1. type 1 into the cell which is adjacent to the first data you want to add ID number.
doc unique id number to duplicate rows 2

2. Then in the cell below it, type this formula =IF(B1=B2,A1,A1+1), press Enter key to get the first result, drag fill handle down until last data showing up.

In the formula, B1, B2 are the first two cells in the duplicate data column, A1 is the first ID cell.
doc unique id number to duplicate rows 3

Adding missing ID number with Kutools for Excel

If you have a list of ID numbers which including some missing numbers as below screenshot shown, you can apply Kutools for Excel’s Find Missing Sequence Number utility to quickly find and add the missing number.
doc unique id number to duplicate rows 4

Kutools for Excel, with more than 300 handy functions, makes your jobs more easier. 

After installing Kutools for Excel, please do as below:(Free Download Kutools for Excel Now!)

1. Select the ID numbers you want to insert missing numbers, click Kutools > Insert > Find Missing Sequence Number.
doc unique id number to duplicate rows 5

2. In the popping dialog, you can choose one option to add or highlight missing numbers as you need.
doc unique id number to duplicate rows 6

3. Click Ok. A dialog pops out to remind you the number of missing data, close it. Then all missing numbers have been added or highlighted in the column or beside the column.

Add missing numbers  Find the missing rows
doc unique id number to duplicate rows 7 doc unique id number to duplicate rows 8

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...
  • 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.
kte tab 201905

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!
officetab bottom
Comments (1)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
La formula no funciona ¿podrás compartir la correcta?
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations

Follow Us

Copyright © 2009 - | All rights reserved. Powered by ExtendOffice. | Sitemap
Microsoft and the Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.
Protected by Sectigo SSL