I'm looking to count the number of periods in a string and add values based on that number.
Here I have a hierarchy and it currently looks like this:
1
1.1
1.1.1
1.1.1.1
I need to modify it so that it will look like this:
1.0.0.0.0.0.0.0
1.1.0.0.0.0.0.0
1.1.1.0.0.0.0.0
1.1.1.1.0.0.0.0
I tried this equation in a column named [Item Hierarchy] which referenced a column named [Item]:
=IF(COUNTIF([Item]@row, CONTAINS(".", [Item]@row)) = 0, [Item]@row + ".0.0.0.0.0")
Thanks
Best Answer
-
=LEN(Item@row) - LEN(SUBSTITUTE(Item@row, ".", ""))
Try that
Dr. St Nicholas Burrus DHA, PMP
I build Smartsheets for the US Government, State Government, and about a dozen of the US Fortune 100s.
Answers
-
=LEN(Item@row) - LEN(SUBSTITUTE(Item@row, ".", ""))
Try that
Dr. St Nicholas Burrus DHA, PMP
I build Smartsheets for the US Government, State Government, and about a dozen of the US Fortune 100s.
-
That worked! thank you so much!
-
Damn, you're good, Nick. Just found this. Worked for me. Thanks.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.9K Get Help
- 410 Global Discussions
- 219 Industry Talk
- 457 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!