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
- Customer Resources
- 65.1K Get Help
- 444 Global Discussions
- 142 Industry Talk
- 472 Announcements
- 5K Ideas & Feature Requests
- 83 Brandfolder
- 150 Just for fun
- 71 Community Job Board
- 489 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 301 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!