Creating a Unique ID (YY-###)
I'm looking to create a unique ID per entry as YY-### that will reset each year (24-001, 24-002, 24-003, 25-001, 25-002 etc)
Row ID: (auto number column)
YYYY: =YEAR([Date Submitted]@row)
YY: =RIGHT(YEAR([Date Submitted]@row), 2)
Entry ID: =YY@row + "-" + IF(COUNTIFS(YYYY:YYYY, YYYY@row, [Row ID]:[Row ID], <=[Row ID]@row) < 10, "00" + COUNTIFS(YYYY:YYYY, YYYY@row, [Row ID]:[Row ID], <=[Row ID]@row), IF(COUNTIFS(YYYY:YYYY, YYYY@row, [Row ID]:[Row ID], <=[Row ID]@row) < 100, "0" + COUNTIFS(YYYY:YYYY, YYYY@row, [Row ID]:[Row ID], <=[Row ID]@row), COUNTIFS(YYYY:YYYY, YYYY@row, [Row ID]:[Row ID], <=[Row ID]@row)))
My only issue is if I delete a row, IDs for subsequent rows in the same year change.
How can I keep 24-003 from changing to 24-002 if I delete the row of 24-002?
Thanks in advance!
Best Answer
-
You would need to use a copy row automation to send the row over to a second sheet with the new unique ID being static data and then work from there.
Also… An easier way to zero-fill (also cuts out the need for both year columns)…
=RIGHT(YEAR([Date Submitted]@row), 2) + "-" + RIGHT("00" + COUNTIFS([Date Submitted]:[Date Submitted], IFERROR(YEAR(@cell), 0) = IFERROR(YEAR([Date Submitted]@row), 9999), [Row ID]:[Row ID], @cell <= [Row ID]@row), 3)
Answers
-
You would need to use a copy row automation to send the row over to a second sheet with the new unique ID being static data and then work from there.
Also… An easier way to zero-fill (also cuts out the need for both year columns)…
=RIGHT(YEAR([Date Submitted]@row), 2) + "-" + RIGHT("00" + COUNTIFS([Date Submitted]:[Date Submitted], IFERROR(YEAR(@cell), 0) = IFERROR(YEAR([Date Submitted]@row), 9999), [Row ID]:[Row ID], @cell <= [Row ID]@row), 3)
-
Thank you Paul!
-
Happy to help. 👍️
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.7K Get Help
- 406 Global Discussions
- 217 Industry Talk
- 456 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 297 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!