1

I need to create a unique ID from an existing list of order numbers. Pls see the image below: enter image description here

What I want is for the existing duplicate order numbers to be made unique by adding an extra digit to the end.

At the moment for about 300 rows with different sets of order numbers, I make numbers form 1-300(or however long the list) & join the order numbers with that manually. That makes the IDs too long.

enter image description here

Pls see this sheet for the examples: https://docs.google.com/spreadsheets/d/1VENgvRAdBaAC28lpJ5a2QvD5KtnD-S3dx5rUELzvGCM/edit#gid=170066588

I did do some research on this, and what I always get is creating unique IDs from scratch, getting unique numbers from duplicates using UQNIQUE formula or removing duplicates. I just want to add a digit to the end of each set of order numbers to make that unique.

1
  • Please show what you tried and add a brief description of your search efforts as is suggested in How to Ask.
    – Rubén
    Apr 3, 2021 at 16:55

1 Answer 1

2

Please use

=ARRAYFORMULA(IF(LEN(B2:B),B2:B&"-"&COUNTIFS(B2:B,B2:B,ROW(B2:B),"<="&ROW(B2:B)),))

enter image description here

Functions used:

2
  • I prefer B2:B="","" over LEN(B2:B) but is there an advantage or disadvantage to either?
    – CodeCamper
    Apr 4, 2021 at 6:37
  • @marikamitsos Again! Thank you so much it worked. :) :) :)
    – Genny
    Apr 4, 2021 at 12:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.