Count special characters in a cell
I'm wondering if it's possible to count special characters in a cell, created from a cell formula
Count String Occurrence in a Cell — Smartsheet Community
What I'm currently doing is adding a period to a JOIN(COLLECT function which I am counting the periods. See below:
=JOIN(COLLECT(Post$1:Post$300, [Position Status]$1:[Position Status]$300, "Green", [Name Selection]$1:[Name Selection]$300, ""), "." + CHAR(10))
Where this is the formula counting the periods:
=((LEN([SITE / LOCATION]344) - LEN(SUBSTITUTE([SITE / LOCATION]344, ".", ""))) / LEN(".")) + 1
However, what I'd like to do is count the CHAR(10). I don't think it's possible, but it's worth asking the community. Let me know!
Sincerely,
Jacob Stey
Best Answer
-
Hey @SteyJ
You can count CHAR(10). I tested this formula
=LEN(JOIN(COLLECT(Post:Post, [Position Status]:[Position Status], "Green", [Name Selection]:[Name Selection], ""), "." + CHAR(10))) - LEN(SUBSTITUTE(JOIN(COLLECT(Post:Post, [Position Status]:[Position Status], "Green", [Name Selection]:[Name Selection], ""), "." + CHAR(10)), CHAR(10), ""))
Will this work for you?
Kelly
Answers
-
Hey @SteyJ
You can count CHAR(10). I tested this formula
=LEN(JOIN(COLLECT(Post:Post, [Position Status]:[Position Status], "Green", [Name Selection]:[Name Selection], ""), "." + CHAR(10))) - LEN(SUBSTITUTE(JOIN(COLLECT(Post:Post, [Position Status]:[Position Status], "Green", [Name Selection]:[Name Selection], ""), "." + CHAR(10)), CHAR(10), ""))
Will this work for you?
Kelly
-
@Kelly Moore Amazing solution! wow!! Thank you very much
I modified it slightly to suite my needs:
=LEN(JOIN(COLLECT(Post:Post, [Position Status]:[Position Status], "Green", [Name Selection]:[Name Selection], ""), CHAR(10))) - LEN(SUBSTITUTE(JOIN(COLLECT(Post:Post, [Position Status]:[Position Status], "Green", [Name Selection]:[Name Selection], ""), CHAR(10)), CHAR(10), "")) + 1
Sincerely,
Jacob Stey
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 62.3K Get Help
- 364 Global Discussions
- 199 Industry Talk
- 428 Announcements
- 4.4K Ideas & Feature Requests
- 136 Brandfolder
- 127 Just for fun
- 128 Community Job Board
- 445 Show & Tell
- 28 Member Spotlight
- 1 SmartStories
- 283 Events
- 35 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!