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
Check out the Formula Handbook template!