Count Number of Cells that Contain Certain Text?
Hello,
I am trying to count the number of cells that contain certain words, such as "NYSEG" or "RGE," when the cells may contain more than one of these words.
I have tried using =COUNT(FIND("ConEd", [Utilities]:[Utilities])), but it always turns back a 1 (no matter how many cells actually contain "ConEd").
I am trying to return something along the lines of :
Utility|Number of Cells that mention
ConEd | 5
NYSEG | 10
etc.
Thank you!
Comments
-
Try
=COUNTIF([Utilities]:[Utilities]; FIND("ConEd";@cell)> 0)
-
ecosbar ✭
Thank you for the suggestion! Unfortunately it is returned as "UNPARSEABLE" in Smartsheet.
-
Andrée Starå ✭✭✭✭✭✭
Hi,
Did you get it working?
Happy Holidays & Happy New Year!
Best,
Andrée Starå
Workflow Consultant @ Get Done Consulting
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå| Workflow Consultant / CEO @WORK BOLD
W:www.workbold.com| E:[email protected]| P: +46 (0) - 72 - 510 99 35
Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.
-
ecosbar ✭
Hi! Thank you for checking in; unfortuantely I have not been able to. Do you have any suggestions?
-
Andrée Starå ✭✭✭✭✭✭
Hi,
Try this.
Place the formula below in the "Number of Cells that mention" column.
The Utility@row part in the formula looks at the Utility row and search for the text there like "ConED" or "NYSEG".
=COUNTIF(Utilities:Utilities; FIND(Utility@row;@cell)> 0)
The same version but with the below changes for your and others convenience.
=COUNTIF(Utilities:Utilities, FIND(Utility@row,@cell)> 0)
Depending on your country you’ll need to exchange the comma to a period and the semi-colon to a comma.
Did it work?
Happy New Year!
Best,
Andrée Starå
Workflow Consultant @ Get Done Consulting
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå| Workflow Consultant / CEO @WORK BOLD
W:www.workbold.com| E:[email protected]| P: +46 (0) - 72 - 510 99 35
Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.
-
ecosbar ✭
Hi there! Thank you for your help; unfortunately this is still returning an #UNPARSEABLE error. Do you have any further suggestions?
Emily
-
Andrée Starå ✭✭✭✭✭✭
Hi Emily,
Can you share the formula or the sheet?
Best,
Andrée
SMARTSHEET EXPERT CONSULTANT & PARTNER
Andrée Starå| Workflow Consultant / CEO @WORK BOLD
W:www.workbold.com| E:[email protected]| P: +46 (0) - 72 - 510 99 35
Feel free to contact me about help with Smartsheet, integrations, general workflow advice, or something else entirely.
-
John Swain ✭✭
我有时看到# UNPARSEABLE错误当there are blank fields within the range you are searching. Try filling in blank fields (save) and run the formula again or TIP: Add the IFERROR function to your formula to ensure that you don't get an error if @cell encounters a blank cell in the formula.
-
Nancy Heater ✭✭
I'm trying to use this same formula to look up any instance of great_dane in a column and am getting the same #UNPARSEABLE result.
If we wanted to add IFERROR as suggested, how would this be added to the example below:
=COUNTIF(Dogs:Dogs, FIND(great_dane@row,@cell)> 0)
-
Sean Morgan Employee
Hello@Nancy Heater,
When searching for greast_dane, is this a text value in a cell?
你可能想尝试“great_dane”,或者如果the underscore is to account for a space, you may instead opt for "great dane", but please ensure you are case sensitive with the letter included in the words you are searching for, as well as include quotation marks when searching for words or phrases.
In addition to this, the @row section and FIND may not be necessary if you are searching for this on the same Sheet. If on the same Sheet, you could just use =COUNTIFS(Dogs:Dogs, "great_dane")
Regards
Sean
-
Irene D ✭
Hi@Sean Morgan,
When I tried the formula you suggested on my sheet (replacing Dogs and "great_dane" with the applicable terms), I unfortunately get the following error message: #BLOCKED
Do you know what the cause is and how to fix it?
Thanks,
Irene
-
Genevieve P. Employee Admin
Hi@Irene D
Where are you placing the formula, is it in a different column in the same sheet?
Can you check through the column you're referencing (Dogs:Dogs) to see if there's an error in this column? Sometimes errors can create a domino effect, so if the column you're referencing has a #BLOCKED message this will come through in your other formula.
If neither of this has helped, it would be useful to see a screen capture of your sheet, but please block out sensitive data.
Cheers,
Genevieve
-
Irene D ✭
Hi@Genevieve P,
I think the Smartsheet plan may have been glitching since changing the column properties, then changing them back fixed the issue. However, a new issue arose since I learned that if the Discipline column contains "CMC," but isn't a match case, then it doesn't go towards the count in the formula below. Could you potentially help me add "or" statements to include all disciplines that contain the word CMCoris there a way to change it so it picks up anything in the discipline column that contains the word CMC?
=COUNTIFS(Document:Document, =1, Discipline:Discipline, "CMC", Status:Status, "Not Started")
Thank you!
Irene
-
Genevieve P. Employee Admin
Hi@Irene D
No problem! There are two potential ways for doing this, depending on the type of column your "Discipline" column is set as - is it a Multi Select column? If so, we would usethe HAS function.Otherwise, if it's a text/number column, we could usethe CONTAINS function.
Here's how you would use HAS, if it's Multi-Select:
=COUNTIFS(Document:Document, =1, Discipline:Discipline,HAS(@cell, "CMC"), Status:Status, "Not Started")
-
Another similar question arose for me recently. Instead of specifying the discipline, is there a way for me to include everything in the discipline column except anything that contains CMC?
Thanks again!
Irene
Help Article Resources
Categories
Check out theFormula Handbook template!
Instead of applying the formula to \"Multiselect Text String\" row, did you tried with \"Multiselect Values\" row?<\/p>
=IF(HAS([Multiselect Values]@row, [Component ID]@row), \"MATCH\", \"NO MATCH\")<\/p>
Thank you,<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[]},{"discussionID":109493,"type":"question","name":"I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","excerpt":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5 different statuses in a separate column. So using the screenshot I've provided as an example (although it doesn't have 5 different statuses in the…","snippet":"Hello, I am attempting to come up with a sheet summary formula that counts cells if they meet at least one of 3 different statuses in the same column, AND also meet one of 5…","categoryID":322,"dateInserted":"2023-08-25T20:03:21+00:00","dateUpdated":null,"dateLastComment":"2023-08-26T00:34:49+00:00","insertUserID":165710,"insertUser":{"userID":165710,"name":"SmarsheetNewb","url":"https:\/\/community.smartsheet.com\/profile\/SmarsheetNewb","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-26T00:33:27+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":161714,"lastUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-26T01:04:51+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":23,"score":null,"hot":3386005690,"url":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109493\/i-am-having-trouble-using-and-or-countif-s-to-build-a-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109493,"commentID":392692,"name":"Re: I am having trouble using \"And\", \"OR\" & \"Countif(s)\" to build a formula.","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392692#Comment_392692","dateInserted":"2023-08-26T00:34:49+00:00","insertUserID":161714,"insertUser":{"userID":161714,"name":"Carson Penticuff","url":"https:\/\/community.smartsheet.com\/profile\/Carson%20Penticuff","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/B0Q390EZX8XK\/nBGT0U1689CN6.jpg","dateLastActive":"2023-08-26T01:04:51+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-26T00:33:25+00:00","dateAnswered":"2023-08-25T20:44:12+00:00","acceptedAnswers":[{"commentID":392662,"body":"
Try this:<\/p>
=COUNTIFS([Item Number]:[Item Number], OR(@cell = \"C001\", @cell = \"COO2\", @cell = \"COO3\", @cell = \"COO4\"), [Status]:[Status], OR(@cell = \"Green\", @cell = \"Yellow\", @cell = \"Red\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":322,"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":254,"urlcode":"formulas","name":"Formulas"}]},{"discussionID":109474,"type":"question","name":"Help with date calculation formula","excerpt":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the resolution date is blank I want it to use the current date in the calculation to see how long this issue has gone unresolved. Any help is much…","snippet":"Hello, I'm trying to find a formula that will help me calculate how long an intake took to resolve. The rows I need to be calculated are Date Reported & Resolution Date. If the…","categoryID":322,"dateInserted":"2023-08-25T16:29:39+00:00","dateUpdated":"2023-08-25T16:29:59+00:00","dateLastComment":"2023-08-25T23:01:30+00:00","insertUserID":165688,"insertUser":{"userID":165688,"name":"Nwest","title":"Systems Analyst","url":"https:\/\/community.smartsheet.com\/profile\/Nwest","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!ukHVZ18ImX4!BcjWAe8S9SY!l7iQo_PZHOx","dateLastActive":"2023-08-25T17:22:30+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":165688,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":23,"score":null,"hot":3385987269,"url":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/109474\/help-with-date-calculation-formula","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":109474,"commentID":392687,"name":"Re: Help with date calculation formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/392687#Comment_392687","dateInserted":"2023-08-25T23:01:30+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-08-26T17:06:33+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-25T17:04:22+00:00","dateAnswered":"2023-08-25T16:36:59+00:00","acceptedAnswers":[{"commentID":392622,"body":"