COUNTIF & Multi-Selection下拉菜单——计数多个条目
我的数据输入表有几个列是多选择下拉。对于我的Metrics摘要页面,当用户选择多个选项时,我很难使用COUNTIF。
Multi-selection下拉菜单中的选项示例:
- 苹果
- 梨
- 葡萄
- 香蕉
- 其他
我需要指导如何在选择多个选项时构建标准,例如Apple & Pear。我想要的苹果和梨要成为一个不同的计数,不要计算Apple或Pear在范围中单独使用的所有次数。
使用所示的数据集,我应该得到以下总数:
- Apple - 1(不是4,这是范围内的总数)
- 梨- 1(不是3,这是范围内的总数)
- 葡萄- 2颗
- 其他- 1
- 苹果梨- 2
- 苹果香蕉- 1个
答案
-
kolfinna ✭✭✭✭
嘿,
我试图在我的表格摘要中使用类似的公式来计算给定列表中小学教师的数量。到目前为止,我已经:
=COUNTM([学生年龄组]:[学生年龄组],AND(HAS("小学")))
但当我运行它时,它返回10作为答案-然而,只有2行包含该文本。
我错过了什么?
-
保罗新来的 ✭✭✭✭✭✭
COUNTM被设计用来计算选择的数量。要对特定文本进行计数,您将需要使用类似于…
=COUNTIFS([学生年龄组别]:[学生年龄组别],CONTAINS("Elementary"@cell))
thinkspi.com
-
kolfinna ✭✭✭✭
就是这个。非常感谢!
-
保罗新来的 ✭✭✭✭✭✭
-
MJayMay ✭
当有多个选择时使用什么语法?从上面的例子——苹果梨?
我可以使用CONTAINS轻松地找到/计数单个条目,但还没有找到一种方法来识别/计数不同的多个组合。我需要理解你在下面的公式中是如何引用苹果梨的。
= COUNTIFS([Test - Fruit]:[Test - Fruit], CONTAINS("Apple Pear")@cell)
-
保罗新来的 ✭✭✭✭✭✭
好的。多选择列的分隔符是一个换行符,可以写成CHAR(10)。
所以你要搜索的不是“Apple Pear”,而是“Apple”+ CAR(10) +“Pear”。
=COUNTIFS([Test - Fruit]:[Test - Fruit], @cell =“苹果”+ CAR(10) +“梨”)
thinkspi.com
-
Ketin梅瑞尔 ✭
该团队选择使用1个增量而不是变量,这使得使用mcount方法来依赖会话可用性单元中的所有选择的问题更加整洁。
-
吉姆克 ✭
谢谢! !这对我很有效!️
-
保罗新来的 ✭✭✭✭✭✭
-
保罗新来的 ✭✭✭✭✭✭
帮助文章参考资料欧宝体育app官方888
If you have a unique ID (like ticket number) that is in both sheets, you could use DataMesh if you have access to that or cross sheet formulas to pull in the data you want based on the matching unique ID.<\/p>
Otherwise, you'd have to use an Add-on. If you are interested in hearing about an add-on that can do this, send me a message at https:\/\/smartsheetguru.com\/contact<\/a><\/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":106845,"type":"question","name":"Count function","excerpt":"Hi I need help with a formula. I have a column that I want to count but only based on a values in a different column. I have tried the following formula but it's not working and I can't figure out what I am doing wrong. =countif([Test Script #]:[Test Script #], [Pass ?]:[Pass ?], <> \"N\/A\") The Test Script # column is the…","categoryID":322,"dateInserted":"2023-06-23T17:50:06+00:00","dateUpdated":null,"dateLastComment":"2023-06-23T19:30:43+00:00","insertUserID":127983,"insertUser":{"userID":127983,"name":"Carol-Anne Cerbone","url":"https:\/\/community.smartsheet.com\/profile\/Carol-Anne%20Cerbone","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!h1jY4Qxc4TY!prNYaQRZvvo!a6wiwaB2GsY","dateLastActive":"2023-06-23T19:29:42+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"updateUserID":null,"lastUserID":127983,"lastUser":{"userID":127983,"name":"Carol-Anne Cerbone","url":"https:\/\/community.smartsheet.com\/profile\/Carol-Anne%20Cerbone","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!h1jY4Qxc4TY!prNYaQRZvvo!a6wiwaB2GsY","dateLastActive":"2023-06-23T19:29:42+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":8,"countViews":46,"score":null,"hot":3375096049,"url":"https:\/\/community.smartsheet.com\/discussion\/106845\/count-function","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106845\/count-function","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":106845,"commentID":382093,"name":"Re: Count function","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/382093#Comment_382093","dateInserted":"2023-06-23T19:30:43+00:00","insertUserID":127983,"insertUser":{"userID":127983,"name":"Carol-Anne Cerbone","url":"https:\/\/community.smartsheet.com\/profile\/Carol-Anne%20Cerbone","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!h1jY4Qxc4TY!prNYaQRZvvo!a6wiwaB2GsY","dateLastActive":"2023-06-23T19:29:42+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Formulas and Functions","url":"https:\/\/community.smartsheet.com\/categories\/formulas-and-functions"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-23T19:30:46+00:00","dateAnswered":"2023-06-23T19:28:59+00:00","acceptedAnswers":[{"commentID":382092,"body":"