How can I set a Row ID column that does not change when you move, add or delete rows
Hi all -
I've been able to create a Row ID column that updates when you add/delete a row fairly well, but when rows are moved around it breaks again.
Current set up:
X: autonumber column
Row ID: =MATCH(X@row, X:X, 0)
This works ok but every time I move rows or make big changes I have to re-set the autonumber (X) column. I just need a column that mimics the row# that smartsheet already provides (1st column before the primary)
Thanks!
Answers
-
Hello @mclawrence_123 I found this formula from Paul Newcome that works great for this:
=COUNTIFS([Column Name]$1:[Column Name]@row, OR(ISBLANK(@cell), NOT(ISBLANK(@cell))))
Update "Column Name" with the primary column in your sheet.
-
Hi @Mr. Chris thank you for this! Are you able to make this a column formula? It isn't letting me
-
@mclawrence_123 In order to make this wonderful formula a column formula you have to replace all @cell with @row.
Ken Armstrong
Smartsheet Project Manager, GE Aerospace
Certified Smartsheet Administrator
Be Firm! Be Fair! Be Friendly! Be Honest!!!
-
So if my primary was called row the column formula would be
=COUNTIFS(Row$1:Row@row, OR(ISBLANK(@row ), NOT(ISBLANK(@row )))) this doesn't seem be working
-
Your Row ID column should update just fine without having to reset your auto-number column using the method outlined in your original post.
-
The reason the COUNTIFS method cannot be made into a column formula because of the absolute references ($ before a column name or row number). Leaving "@row" as a stand-alone point in a formula such as ISBLANK(@row) will break a formula every time. The "@cell" references should stay as is. The COUNTIFS method was derived before column formulas became a thing and has a number of issues with it. I recommend (and consistently use) the method outlined in the original post with no issues.
The only "issue" you may encounter is that the auto-number column does not populate until the sheet is saved. So if you inserted a bunch of rows without saving, the [Row ID] column will appear broken, but if you save the sheet, it should correct itself.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!