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
- 65.5K Get Help
- 447 Global Discussions
- 144 Industry Talk
- 480 Announcements
- 5.1K Ideas & Feature Requests
- 85 Brandfolder
- 152 Just for fun
- 72 Community Job Board
- 492 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 304 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!