从层次结构列条件计算总和的公式

我有下面的表格,我想计算“幻灯片数量”的总和,它出现在层次转换列中。我做了同样的事情,只计算实例个数而不求和,但我不能让这个公式像以前的countif公式那样适用于求和。我还需要计算每个日期的总和。

ss2.JPG


标签:

答案

  • 詹姆斯•马
    詹姆斯•马 ✭✭✭✭

    您可以创建更多的记录来显示日期将如何与您想要求和的数字相关联吗?

    如果我用你提供的数据来解决这个问题,我会这样做:

    创建一个名为Hierarchy Group的列,并在其中添加如下内容:

    =如果(COUNT(祖先((电子邮件保护))) = 0,(电子邮件保护)指数(祖先((电子邮件保护)), 1))

    (查找每个记录的顶级父级)

    然后把这个公式放到公式所在的单元格中:

    =SUMIFS(instance:instance, [hierarchy translation]:[hierarchy translation], "幻灯片数量",[hierarchy group]:[hierarchy group], [hierarchy group]@row)

    这样会得到幻灯片的数量,但我不认为这是你想要的。这个问题的“每个日期”部分似乎行不通。

  • @James马谢谢你!

    这张单子上我有差不多一样的东西。它计算被标识为“Block ID”的行数:

    ss3.JPG


    在第一种情况下,我想做的事情基本相同,但每个日期下的幻灯片数量相加。因此,如果我将第4行添加到第一个工作表,即层次2,幻灯片数量和数量为5,则4/28/22的每个日期的总数为7。

=COUNTIFS([Column4]:[Column4], HAS(@cell, \"orange\"))<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-12-06 09:37:44","updateUser":{"userID":154506,"name":"manasaMS","url":"https:\/\/community.smartsheet.com\/profile\/manasaMS","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-12-06T09:36:56+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"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":98416,"type":"question","name":"Help creating reports from source data that share the Primary Column","excerpt":"Hello! I hope someone can help me with the query below. I have two Sheets that share the Primary Column but any other column is different . I want to create a report that displays the content from both sheets under the same line if they have a Primary column in common. In the example below, the row would display A under…","categoryID":321,"dateInserted":"2022-12-05T17:34:29+00:00","dateUpdated":null,"dateLastComment":"2022-12-06T04:03:55+00:00","insertUserID":155650,"insertUser":{"userID":155650,"name":"vponis","url":"https:\/\/community.smartsheet.com\/profile\/vponis","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/ALm5wu123eObw5fLQtcthrpqsoWY319L3hmQyAsPTpm6=s96-c","dateLastActive":"2022-12-06T04:02:48+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":155650,"lastUser":{"userID":155650,"name":"vponis","url":"https:\/\/community.smartsheet.com\/profile\/vponis","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/ALm5wu123eObw5fLQtcthrpqsoWY319L3hmQyAsPTpm6=s96-c","dateLastActive":"2022-12-06T04:02:48+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":21,"score":null,"hot":3340562304,"url":"https:\/\/community.smartsheet.com\/discussion\/98416\/help-creating-reports-from-source-data-that-share-the-primary-column","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/98416\/help-creating-reports-from-source-data-that-share-the-primary-column","format":"Rich","lastPost":{"discussionID":98416,"commentID":353243,"name":"Re: Help creating reports from source data that share the Primary Column","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/353243#Comment_353243","dateInserted":"2022-12-06T04:03:55+00:00","insertUserID":155650,"insertUser":{"userID":155650,"name":"vponis","url":"https:\/\/community.smartsheet.com\/profile\/vponis","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/ALm5wu123eObw5fLQtcthrpqsoWY319L3hmQyAsPTpm6=s96-c","dateLastActive":"2022-12-06T04:02:48+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Using Smartsheet","url":"https:\/\/community.smartsheet.com\/categories\/using-smartsheet"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/DXWTGW439LHI\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2022-12-06T04:04:01+00:00","dateAnswered":"2022-12-06T04:03:55+00:00","acceptedAnswers":[{"commentID":353243,"body":"

Thank you for the quick reply kirstie858<\/strong><\/a>!<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-12-06 04:04:01","updateUser":{"userID":155650,"name":"vponis","url":"https:\/\/community.smartsheet.com\/profile\/vponis","photoUrl":"https:\/\/lh3.googleusercontent.com\/a\/ALm5wu123eObw5fLQtcthrpqsoWY319L3hmQyAsPTpm6=s96-c","dateLastActive":"2022-12-06T04:02:48+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"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":98392,"type":"question","name":"Summary Formula Result in new Formula","excerpt":"I am generating multiple results in a Summary Sheet. I would like to use these results in a new formula within the same Summary, is this possible? SS_Result1 SS_Result2 new formula =sum([SS-Result1]-[SS-Result2]) otherwise I have to combine the formulas within each against themselves, kinda tedious","categoryID":321,"dateInserted":"2022-12-04T20:14:28+00:00","dateUpdated":null,"dateLastComment":"2022-12-05T14:48:26+00:00","insertUserID":154303,"insertUser":{"userID":154303,"name":"SkiPatrolScott","url":"https:\/\/community.smartsheet.com\/profile\/SkiPatrolScott","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-12-05T17:39:25+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":154303,"lastUser":{"userID":154303,"name":"SkiPatrolScott","url":"https:\/\/community.smartsheet.com\/profile\/SkiPatrolScott","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-12-05T17:39:25+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":20,"score":null,"hot":3340437774,"url":"https:\/\/community.smartsheet.com\/discussion\/98392\/summary-formula-result-in-new-formula","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/98392\/summary-formula-result-in-new-formula","format":"Rich","lastPost":{"discussionID":98392,"commentID":353136,"name":"Re: Summary Formula Result in new Formula","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/353136#Comment_353136","dateInserted":"2022-12-05T14:48:26+00:00","insertUserID":154303,"insertUser":{"userID":154303,"name":"SkiPatrolScott","url":"https:\/\/community.smartsheet.com\/profile\/SkiPatrolScott","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-12-05T17:39:25+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Using Smartsheet","url":"https:\/\/community.smartsheet.com\/categories\/using-smartsheet"},{"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2022-12-05T14:48:17+00:00","dateAnswered":"2022-12-04T23:22:27+00:00","acceptedAnswers":[{"commentID":353095,"body":"

Hey @SkiPatrolScott<\/a> <\/p>

Yes, you can use an existing summary field in another summary field within the same sheet. You can either click into the formula field of the existing formula to add to new formula, or type out the field name. Summary fields use a # in place of a row indicator. Using your example from above:<\/p>

=new formula =[SS-Result1]#<\/strong>-[SS-Result2]#<\/strong><\/p>

If this doesn't make sense, help me understand where I lost you and I will try to explain it better.<\/p>

Kelly<\/p>"},{"commentID":353136,"body":"

Thanks @Kelly Moore<\/a> , I did have to add a ( around the equation ) but it did work.<\/p>

=sum([summary field1]#-[summary field2]) the correct answer was produced.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-12-05 14:48:17","updateUser":{"userID":154303,"name":"SkiPatrolScott","url":"https:\/\/community.smartsheet.com\/profile\/SkiPatrolScott","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-12-05T17:39:25+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"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":[]}],"title":"Trending in Using Smartsheet","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">