Welcome to the Smartsheet Forum Archives
The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, pleaseVisit the Current Forums.
Count cells containing string
I'm trying to create a tally of the number of rows where a specific column contains a string. For example, the contents of a cell = "6-1, 6-2, 7-2" and I want this to be counted as 6-1, as 6-2, and also as 7-2. If this row were to only have one designation, so cell = "6-1", I could do this easily with COUNTIF. But although I canfiltermy rows by whether this cellcontains"6-1", I can't figure out how to specify in a formula that it is allowed tocontain"6-1" and not justequal"6-1".
Also, I have a couple hundred of these designations, so I can't just have a checkbox column for 6-1, column for 6-2, and column for 7-2.
Any ideas? Thanks!!
Comments
-
J. Craig Williams ✭✭✭✭✭✭
Sera,
一个(这是一个联系me). I'm having a difficult time picturing this.
It sounds like a data entry nightmare, not only the back end of counting.
Where will these formulas reside?
If you are going to have a multiitude of "count if 6-1", "count if 6-2", etc... those are going to be in columns, aren't they?
Are all of the designations in one column?
A couple of things that might help without knowing more:
1. when you filter a column, the system lets you know how many items are in the filtered list.
2. a series of reports may be the way to go. each report for a specific designation.
this gives you the count as well.
and if you filter more than a few times, will save you the time to do that because the report is just a click (or two) away.
Hope this helps.
Craig
-
Travis Employee
Hi, are you looking to have a permanent formula for each item you are counting or could you use a dynamic formula that you can quickly update based on what you want to count?
Check out this solution I came up with. I added a checkbox column with a formula that will check the box if the corresponding cell contains the value you specific in a fixed cell. Then there is a formula that counts the checkboxes.
The brown cell contains the value the checkbox formulas are looking for. When you change this value, all the checkbox formulas update to search for the new value. This can get you a quick count for a specific value.
The green box contains the count formula and purple box contains the same formula but with concatenated text which is taken from the value in the brown box.
Here's the sheet:
https://app.smartsheet.com/b/publish?EQBCT=4da45e3ac9e04277bdb86844283468b1
Test it out by changing the value in the brown box.
-
Sera T ✭
Thanks so much for the suggestions! These are both useful, but unfortunately I do think we need to be able to have a list of all the counts around all the time – the purpose is to be able to assess the coverage of each designation by the whole dataset. If there's a list we can scan, it's a 10-minute job to find the areas of low coverage, but if we have to manually move through reports or change a formula it becomes a several-hours job.
我希望我可以得到一个尽管条件统计公式rate through the cells of a column and perform the FIND formula on each of them. I think my tentative plan is to make another sheet, link to the relevant column containing all the designations, and go through and make a FIND column like Travis did above for each designation. I'll put a count at the top of each column, and then this will be either useable as-is, or I can link from somewhere else to the counts. Kind of a round-about way of getting something to iterate, but I think it should work.
My other possible non-elegant solution is to provide 5 or 6 columns to add up to one designation per cell instead of a concatenated "6-1, 6-2, 6-3". Then I'm thinking I could get a nested COUNTIF to work.
-
Travis Employee
Will each cell contains three values? "6-1, 6-2, 6-3"
You might consider changing the way you enter the information. You could have three columns, one for each value, then have a forth which can concatenate the values from the other three columns. With this method you could use a COUNTIF to count the number of times a value exists in the three columns.
Here's an example:
https://app.smartsheet.com/b/publish?EQBCT=dc04416e768c48d79c174a261c7f4128
Data in columns Value 1, Value 2, and Value 3 are added manually.
This is the formula in the Concatenate column:
=[Value 1]1 + ", " + [Value 2]1 + ", " + [Value 3]1
This is the formula in the Primary column. I added text at the end, but this can be removed if you dont need it:
=COUNTIF([Value 1]1:[Value 3]8, "6-1") + " are 6-1"
This is set up for three values but you can add as many columns as you need. Just adjust the formulas to account for the additional columns.
-
Sera T ✭
Thanks! I think I'll do it this way. Most rows will have only one value, with some rows having (hopefully not more than) 5 values, so it's not the most elegant use of space, but it will certainly get the job done!
Categories
I hope you're well and safe!<\/p>
There's a known issue at the moment.<\/p>
I'll get back to the post if I can find the thread.<\/p>
I hope that helps!<\/p>
Be safe, and have a fantastic weekend!<\/p>
Best,<\/p>
Andrée Starå<\/strong><\/a> | Workflow Consultant \/ CEO @ WORK BOLD<\/strong><\/a><\/p> ✅Did my post(s) help or answer your question or solve your problem? Please support the Community by <\/em>marking it Insightful\/Vote Up, Awesome, or\/and as the accepted answer<\/em><\/strong>. It will make it easier for others to find a solution or help to answer!<\/em><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":108880,"type":"question","name":"Recover a Row that was accidentally moved then deleted","excerpt":"I was attempting to copy a row from sheet 1 to sheet 2, but I accidentally moved the row then deleted it, but then realized belatedly that the original (now deleted) data in sheet 1 had been moved. Apparently one can not simply use the \"undo action\" arrow after moving something--the option is grayed out as in not…","snippet":"I was attempting to copy a row from sheet 1 to sheet 2, but I accidentally moved the row then deleted it, but then realized belatedly that the original (now deleted) data in sheet…","categoryID":321,"dateInserted":"2023-08-11T22:27:56+00:00","dateUpdated":null,"dateLastComment":"2023-08-12T05:12:42+00:00","insertUserID":165013,"insertUser":{"userID":165013,"name":"GlennJo","title":"Riparian Stewardship Program Manager","url":"https:\/\/community.smartsheet.com\/profile\/GlennJo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-12T03:46:04+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":165013,"lastUser":{"userID":165013,"name":"GlennJo","title":"Riparian Stewardship Program Manager","url":"https:\/\/community.smartsheet.com\/profile\/GlennJo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-12T03:46:04+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":29,"score":null,"hot":3383611238,"url":"https:\/\/community.smartsheet.com\/discussion\/108880\/recover-a-row-that-was-accidentally-moved-then-deleted","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/108880\/recover-a-row-that-was-accidentally-moved-then-deleted","format":"Rich","lastPost":{"discussionID":108880,"commentID":390348,"name":"Re: Recover a Row that was accidentally moved then deleted","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/390348#Comment_390348","dateInserted":"2023-08-12T05:12:42+00:00","insertUserID":165013,"insertUser":{"userID":165013,"name":"GlennJo","title":"Riparian Stewardship Program Manager","url":"https:\/\/community.smartsheet.com\/profile\/GlennJo","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-08-12T03:46:04+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":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-08-12T03:46:02+00:00","dateAnswered":"2023-08-11T23:45:38+00:00","acceptedAnswers":[{"commentID":390342,"body":"