均值if和and函数

你好,

我迷路了,真的需要帮助。我试图在Sheet Summary中构建一个公式,以捕获用特定的变更优先级、季度和年设置的变更的平均吞吐量。我的公式是:

=AVERAGEIF(Throughput:Throughput, AND([更改优先级]:[更改优先级]= "Critical",[关闭季度]:[关闭季度]= "Q4",[关闭年度]:[关闭年度]= "2021"))

上面的公式返回#无效操作。我还会补充,你可以排除任何空白字段导致的问题。表的设置是这样的,如果更改仍然是OPEN,则不会在我引用的字段中填充任何数据。

我确信我没有完全理解如何使用AND函数,这可能是问题所在。欢迎所有指导!

谢谢你~Marlayna

标签:

最佳答案

  • 吉纳维芙P。
    吉纳维芙P。 员工管理
    ✓回答

    @Marlayna沙利文

    每个函数都有不同的结构。如果你现在使用的是AVERAGEIF,那么结构是这样的:

    = AVERAGEIF (列为标准,“标准”,列为平均)

    看到的:https://help.smartsheet.com/function/averageif

    看起来你只是在开始的时候得到了你想要平均的列,而不是在结束的时候!尝试交换这个,并让我知道如果您仍然得到一个错误。

    欢呼,

    吉纳维芙

答案

  • Leibel博士Shuchat
    Leibel博士Shuchat ✭✭✭✭✭

    @Marlayna沙利文

    只有当吞吐量列有多个标准(例如大于100小于1000)时,AND函数才会在这种情况下工作。

    在这种情况下,你需要使用COLLECT函数并将其输入到AVG函数:

    =AVG(COLLECT([Throughput]:[Throughput], [Change Priority]:[Change Priority], @cell = "Critical", [Closed Quarter]:[Closed Quarter], @cell = "Q4", [Closed Year]:[Closed Year], @cell = "2021"))

  • @Leibel Shuchat

    我有一种感觉,我没有正确地使用AND函数,然而,当我输入你上面的公式,它给出了不同的错误:

    #除零

    有人知道为什么会这样吗?

  • Leibel博士Shuchat
    Leibel博士Shuchat ✭✭✭✭✭

    这意味着它不会返回与您输入的条件匹配的任何行

  • Marlayna沙利文
    编辑01/14/22

    早....@Leibel Shuchat

    我使用的表格摘要,我认为可能会导致一些问题,所以不是建立从领域的信息,我切换战术,使用其他的摘要,这是预期的功能。下面是新的公式:

    =AVG(吞吐量:吞吐量,[Q3 2021临界关闭计数]#)

    然而,这个平均数是错误的。它的计算结果是158.47345,但是当突出显示单元格时,平均吞吐量为60.78。

    image.png

    我还切换了公式来检查SUM,它也错误地显示为429780。

  • 吉纳维芙P。
    吉纳维芙P。 员工管理

    @Marlayna沙利文

    在这个最新的公式中,你只使用了AVG。这只会对你指定的值进行平均,而不会使用IF语句来过滤你的行。这意味着它将对吞吐量列中的所有值进行平均,并将其与[Q3 2021临界关闭计数]#中的值结合起来进行平均

    看到的:https://help.smartsheet.com/function/avg

    上面的AVG(COLLECT)解决方案是基于其他列中列出的多个标准对一列求平均值的最佳方法。

    如果它对你不起作用,我们能检查一下它是否符合你的标准吗?使用COUNTIFS来计算它找到的行数:

    =COUNTIFS([更改优先级]:[更改优先级],@cell = "危急",[关闭季度]:[关闭季度],@cell = "Q4",[关闭年度]:[关闭年度],@cell = "2021")


    如果这是找到正确的行数(你可以通过添加一个过滤器来检查表),那么这应该工作:

    =AVG(COLLECT(Throughput:Throughput,[更改优先级]:[更改优先级],@cell = "Critical",[封闭季度]:[封闭季度],@cell = "Q4",[封闭年]:[封闭年],@cell = "2021"))

    如果这对您不起作用,那么查看包含数据和列的底层工作表的屏幕截图会很有帮助,但请屏蔽敏感数据。

    谢谢!

    吉纳维芙

  • @Genevieve P。

    谢谢你跟进这个项目。我最终创建了一个“助手”列,将大量信息(季度、年、优先级)收集到一个位置,但公式仍然不能在表单摘要中正确工作。

    下面是新的公式:

    =AVERAGEIF(Throughput:Throughput, [Throughput Helper]:[Throughput Helper], ="Q4 2021 Critical")


    image.png

    它应该显示72.07天,但我得到#无效数据类型。

  • 吉纳维芙P。
    吉纳维芙P。 员工管理
    ✓回答

    @Marlayna沙利文

    每个函数都有不同的结构。如果你现在使用的是AVERAGEIF,那么结构是这样的:

    = AVERAGEIF (列为标准,“标准”,列为平均)

    看到的:https://help.smartsheet.com/function/averageif

    看起来你只是在开始的时候得到了你想要平均的列,而不是在结束的时候!尝试交换这个,并让我知道如果您仍然得到一个错误。

    欢呼,

    吉纳维芙

帮助文章资源欧宝体育app官方888

@Paul G.<\/a> <\/p>

I tested it out on a sheet just now. If I change the date column properties to have \"Restrict to dates only\" selected then it didn't like me entering 04\/31\/22. That should fix it I believe. Since you're the sheet owner (I'm guessing), then you'll get a warning which will allow you to enter a non-date but others won't get the warning. They just won't be allowed to enter non-dates or dates such as 04\/31\/22 or 02\/30\/22.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-08-25 22:58:19","updateUser":{"userID":146734,"name":"Paul G.","url":"https:\/\/community.smartsheet.com\/profile\/Paul%20G.","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-08-25T23:49:28+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"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":94640,"type":"question","name":"Need Formula Help Multiple Date Columns, count days, if blank choose other column","excerpt":"I have Multiple date columns for approvals. I want to find the number of days between columns, but some are blank so I need it to choose another date column based on what I set. I've included example data.","categoryID":322,"dateInserted":"2022-08-24T20:45:19+00:00","dateUpdated":"2022-08-24T20:46:14+00:00","dateLastComment":"2022-08-25T17:13:45+00:00","insertUserID":151431,"insertUser":{"userID":151431,"name":"Geilisa","url":"https:\/\/community.smartsheet.com\/profile\/Geilisa","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-08-25T17:13:57+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":151431,"lastUserID":151431,"lastUser":{"userID":151431,"name":"Geilisa","url":"https:\/\/community.smartsheet.com\/profile\/Geilisa","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-08-25T17:13:57+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":6,"countViews":44,"score":null,"hot":3322825144,"url":"https:\/\/community.smartsheet.com\/discussion\/94640\/need-formula-help-multiple-date-columns-count-days-if-blank-choose-other-column","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/94640\/need-formula-help-multiple-date-columns-count-days-if-blank-choose-other-column","format":"Rich","tagIDs":[254],"lastPost":{"discussionID":94640,"commentID":341210,"name":"Re: Need Formula Help Multiple Date Columns, count days, if blank choose other column","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/341210#Comment_341210","dateInserted":"2022-08-25T17:13:45+00:00","insertUserID":151431,"insertUser":{"userID":151431,"name":"Geilisa","url":"https:\/\/community.smartsheet.com\/profile\/Geilisa","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-08-25T17:13:57+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,"image":{"url":"https:\/\/us.v-cdn.net\/6031209\/uploads\/ADVXWG7LFUY9\/image.png","urlSrcSet":{"10":"","300":"","800":"","1200":"","1600":""},"alt":"image.png"},"attributes":{"question":{"status":"accepted","dateAccepted":"2022-08-25T17:13:56+00:00","dateAnswered":"2022-08-25T17:13:45+00:00","acceptedAnswers":[{"commentID":341210,"body":"

\n \n https:\/\/community.smartsheet.com\/discussion\/comment\/341187#Comment_341187\n <\/a>\n<\/div>\n

This is almost perfect. I had to do<\/p>

=[Person B Approval]@row - MAX([Start Column Date]@row,[Person A Approval]@row)<\/p>

Basically the same, thank you so much!<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-08-25 17:13:56","updateUser":{"userID":151431,"name":"Geilisa","url":"https:\/\/community.smartsheet.com\/profile\/Geilisa","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-08-25T17:13:57+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"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":94643,"type":"question","name":"COUNTIFS Formula with NOT function","excerpt":"I'm trying to count the number of cells filled with a date within a column, except for rows that have status as \"On Hold\". The formulas I've tried are: =COUNTIFS({Charter Date}, AND(IFERROR(MONTH(@cell, 0) = 1, IFERROR(YEAR(@cell), 0) = 2022), {Approved Gate}, NOT(@cell = \"On Hold\"))) Output: Invalid Data Type error.…","categoryID":322,"dateInserted":"2022-08-24T21:42:07+00:00","dateUpdated":null,"dateLastComment":"2022-08-25T15:27:32+00:00","insertUserID":151717,"insertUser":{"userID":151717,"name":"Cameron G","url":"https:\/\/community.smartsheet.com\/profile\/Cameron%20G","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-08-25T12:39:09+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":95091,"lastUser":{"userID":95091,"name":"Sameer Karkhanis","url":"https:\/\/community.smartsheet.com\/profile\/Sameer%20Karkhanis","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!Gojd36hb2yQ!xWjdseh3KiQ!Pg1PywniI56","dateLastActive":"2022-08-25T22:38:22+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":3,"countViews":26,"score":null,"hot":3322820379,"url":"https:\/\/community.smartsheet.com\/discussion\/94643\/countifs-formula-with-not-function","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/94643\/countifs-formula-with-not-function","format":"Rich","lastPost":{"discussionID":94643,"commentID":341182,"name":"Re: COUNTIFS Formula with NOT function","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/341182#Comment_341182","dateInserted":"2022-08-25T15:27:32+00:00","insertUserID":95091,"insertUser":{"userID":95091,"name":"Sameer Karkhanis","url":"https:\/\/community.smartsheet.com\/profile\/Sameer%20Karkhanis","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!Gojd36hb2yQ!xWjdseh3KiQ!Pg1PywniI56","dateLastActive":"2022-08-25T22:38:22+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":"2022-08-25T12:39:06+00:00","dateAnswered":"2022-08-25T00:21:42+00:00","acceptedAnswers":[{"commentID":341059,"body":"

That's probably because some of the rows may have no date (aka blank cell) in your {Charter Date} range. Additionally the arguments to the MONTH function are incorrect.<\/p>

Try this:<\/p>

=COUNTIFS({Charter Date}, NOT(ISBLANK(@cell)), {Charter Date}, AND(MONTH(@cell)=1, YEAR(@cell)=2022), {Approved Gate}, <>\"On Hold\")\n<\/pre>


<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question","log":{"dateUpdated":"2022-08-25 12:39:06","updateUser":{"userID":151717,"name":"Cameron G","url":"https:\/\/community.smartsheet.com\/profile\/Cameron%20G","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2022-08-25T12:39:09+00:00","banned":0,"punished":0,"private":false,"label":"✭"}}},"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":[]}],"title":"Trending in Formulas and Functions ","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">