Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

Google Sheets: Create a formula to generate unique sequential IDs for items in a column that don't already have IDs

$
0
0

I am cataloging items in a spreadsheet using Google Sheets. Every item needs a unique ID, which is a sequential code formatted like ABxxxxxx, where AB000000 < ABxxxxxx < AB999999, starting from AB000001, AB000002, AB000003, etc., and counting up to AB999999.

Some items in my sheet already have unique IDs, but many do not. I am trying to find a formula that generates an ID, and checks if the ID is already in a specific column.

If the new ID is not already in the column, then that ID becomes the new, unique ID for the item; otherwise, if the ID is already in the column, generate a new sequential ID, and check again to see if that one is already in the column.

I believe that I can see if the ID is already in the column by using the '''IF''' and '''COUNTIF''' formulas, and I can check to see if a value is unique using the '''UNIQUE''' formula.

However, I cannot seem to find a formula that will generate a new, unique ID for every item in a column which doesn't already have an ID. Attached is a screenshot which hopefully can illustrate what I want my formula to do. Is this even possible in Sheets?

enter image description here

Thank you very much for your time in reading this. I searched through several pages of Google results, and could not find a formula like the one I need. Any help is much appreciated. Thank you.


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>