Adding subsequent row ID numbers to prefix if cell is not blank
Hi all, I'm struggling to create a row ID field where it will populate an ID number ID_RC_1 and so on if the Employee Name cell is not blank. If it's blank then it will populate "-". Is there a way to create sequential numbering to be included after the "ID_RC" prefix?
Looking for : ID_RC_1, ID_RC_2... is name cell is not blank.
Avoiding the auto number system as it populate IDs for rows that are irrelevant.
Thanks in advance for the help!
Best Answer
-
The only way I can think of to do this is to add 2 helper columns.
- AN = Autonumber
- RowNum = IF(NOT(ISBLANK([Employee Name]@row)), INDEX(COLLECT([RowNum]:[RowNum],[AN]:[AN], < [AN]@row, [RowNum]:[RowNum], NOT(ISBLANK(@cell))), COUNT(COLLECT([RowNum]:[RowNum],[AN]:[AN], < [AN]@row, [RowNum]:[RowNum], NOT(ISBLANK(@cell)))))+1,"")
- Row ID = IF(NOT(ISBLANK([Employee Name]@row)), "ID_RC"+[RowNum]@row,"")
Answers
-
The only way I can think of to do this is to add 2 helper columns.
- AN = Autonumber
- RowNum = IF(NOT(ISBLANK([Employee Name]@row)), INDEX(COLLECT([RowNum]:[RowNum],[AN]:[AN], < [AN]@row, [RowNum]:[RowNum], NOT(ISBLANK(@cell))), COUNT(COLLECT([RowNum]:[RowNum],[AN]:[AN], < [AN]@row, [RowNum]:[RowNum], NOT(ISBLANK(@cell)))))+1,"")
- Row ID = IF(NOT(ISBLANK([Employee Name]@row)), "ID_RC"+[RowNum]@row,"")
-
Thank you, I simplified the formula and eliminated the #2 from your answer above for sake of simplicity. The numbering isn't perfect, but it will at least not populate in rows that aren't blank. Appreciate the response!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 441 Global Discussions
- 140 Industry Talk
- 472 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 496 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!