Countif and Multi line cell
Column 1: Status
Column2: Count
Column 1: test
Column 2: =COUNTIF([BOP Status]@row, "test")
Result = 1
Column 1: 2 lines. (1st line "test" , then Alt-enter, then "found in a test"
Column 2: =COUNTIF([BOP Status]@row, "test")
Result =0
Is there something about using Alt-Enter that causes this issue? is there a work-around?
Thanks
Best Answer
-
Hey @DanielGD
It's not necessarily that the Alt-Enter is causing the problem - it's that you're trying to count multiple occurrences in a text string.
There is a work-around
=(LEN([Column 1]@row) - LEN(SUBSTITUTE([Column 1]@row, "test", ""))) / LEN("test")
This is looking at the length (number of characters) of the entire string, subtracts the non "test" characters, which means what is left should be a string length in multiples of the word "test". By dividing by the test length we can see how many multiples were in the original string.
Does this work for you?
Kelly
Answers
-
Hey @DanielGD
It's not necessarily that the Alt-Enter is causing the problem - it's that you're trying to count multiple occurrences in a text string.
There is a work-around
=(LEN([Column 1]@row) - LEN(SUBSTITUTE([Column 1]@row, "test", ""))) / LEN("test")
This is looking at the length (number of characters) of the entire string, subtracts the non "test" characters, which means what is left should be a string length in multiples of the word "test". By dividing by the test length we can see how many multiples were in the original string.
Does this work for you?
Kelly
-
Thank you Kelly. Works perfectly!
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.5K Get Help
- 402 Global Discussions
- 213 Industry Talk
- 450 Announcements
- 4.7K Ideas & Feature Requests
- 141 Brandfolder
- 135 Just for fun
- 56 Community Job Board
- 454 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 296 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!