简体   繁体   中英

Assigning Unique IDs to Possibly Repeating values in another column (Excel)

The below picture represents the functionality I want: One column (in this case column A) has potential duplicates. I want to assign unique IDs to each duplicate in the right column (in this case column B). I am looking for a function/equation which automatically assigns these unique IDs of the corresponding cell on the left (in this case Column A)

How can I achieve this using an Excel equation?

在此处输入图片说明

您应该能够通过将以下公式输入到单元格B2中并向下复制来完成此操作。

=IF(COUNTIF($A$2:A2,A2)>1,VLOOKUP(A2,A:B,2,FALSE),MAX($B$1:B1)+1)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM