# Unique numeric ID

I have a spreadsheet that gets its data from a Google form. I use a formula I found on a forum to generate a unique ID and assign it to every entry avoiding repetition.

`=arrayformula(if(len(B2:B);""&text(row(B2:B)row(B2)+2;"000")&RIGHT(VALUE(B2:B);3);iferror(1/0)))`

The problem I have is that this ID is not permanent and changes every time I add or delete a row in between the first and last entry.

Could anyone help me? I want to avoid the ID to change every time I modify or delete a repeated entry.

• Hi and welcome to WebApps. You say The problem I have is that this ID is not permanent and changes every time I add or delete a row in between the first and last entry. Would you explain why you add or delete rows between the first and last entry? Would you also explain whether this formula is linked directly to the Form Response sheet, or to a copy/paste version of that sheet (maybe copy/paste triggered by `onFormSubmit`)? Would you also provide some examples of the data in Column B? Commented Feb 9, 2022 at 23:08
• I'm surprised that your formula works. For example, `RIGHT(VALUE(B2:B);3)`: `VALUE` converts a string into a number but `RIGHT` returns a substring from a string. So Right(Value) is a contradiction; and `row(B2:B)row(B2)+2` I can only assume that's a type because the inclusion of `row(b2)` generates an error. Was this your original source Unique ID Column? Commented Feb 9, 2022 at 23:28
• As Tedinoz has alluded to, there are a host of factors involved here, factors without which it would be virtually impossible to suggest an effective solution. If you'd like, share a link to the spreadsheet (or to a copy of it). That will be the most efficient means for the volunteer contributors here to figure out both what you have as a starting point and what solutions may work given that information. Commented Feb 9, 2022 at 23:50