简体   繁体   English

从另一个工作表中获取 COUNT(数组公式)

[英]Get COUNT (Array Formula) from another Sheet

Need help on how to get the count from Worked to Productivity sheet:需要有关如何从Worked to Productivity表中获取计数的帮助:

https://docs.google.com/spreadsheets/d/1c3HdMq4PA50pYr88JqPoG51jvru8ipp8ebe4z5DczTQ/edit#gid=1891370548 https://docs.google.com/spreadsheets/d/1c3HdMq4PA50pYr88JqPoG51jvru8ipp8ebe4z5DczTQ/edit#gid=1891370548

  1. In Productivity Sheet (A2) , get unique names that worked within the time of From Date to To DateProductivity Sheet (A2)中,获取在From DateTo Date时间内工作的唯一名称

  2. In Productivity Sheet (B2,C2,D2,E2,F2,G2) , get count within the time of From Date to To Date By (A2) from sheet WorkedProductivity Sheet (B2,C2,D2,E2,F2,G2)中,从工作表中获取From DateDate By (A2) 时间内的计数

  3. In **Productivity Sheet, count how many Valid + Invalid from sheet Worked By (A2)在 **Productivity Sheet 中,计算工作表Worked By (A2) 中有多少有效 + 无效

I have the following formulas:我有以下公式:

={"By"; unique(query(Worked!A2:Q,"select P where Q >= datetime '"&TEXT($B$1,"yyyy-mm-dd HH:mm:ss")&"'"))}
={"Reason 1"; ARRAYFORMULA(COUNTIFS(Worked!F2:F,"1"))}
={"Reason 2"; ARRAYFORMULA(COUNTIFS(Worked!F2:F,"2"))}
={"Reason 3"; ARRAYFORMULA(COUNTIFS(Worked!F2:F,"3"))}
={"Reason 4"; ARRAYFORMULA(COUNTIFS(Worked!F2:F,"4"))}
={"High"; ARRAYFORMULA(COUNTIFS(Worked!C2:C,"High"))}
={"Normal"; ARRAYFORMULA(COUNTIFS(Worked!C2:C,"Normal"))}
={"Total Worked"; ARRAYFORMULA(SUM(F3:G3))}

But I want it to be based on time and date selected on another cell.但我希望它基于在另一个单元格上选择的时间和日期。 Also it doesn't append as ARRAYFORMULA.它也不是 append 作为 ARRAYFORMULA。

I would use an MMULT() for multi-tiered countifs like you're trying to do.我会像您尝试的那样使用 MMULT() 进行多层计数。 MMULT() is a kind of matrix multiplication that's useful for situations like yours. MMULT() 是一种矩阵乘法,对像您这样的情况很有用。

For example, this formula gives the counts for all 4 "reasons":例如,此公式给出了所有 4 个“原因”的计数:

=ARRAYFORMULA({"Reason "&{1,2,3,4};IF(A3:A="",,MMULT(N(A3:A=TRANSPOSE(Worked!P:P)),N(Worked!F:F={1,2,3,4})))})

This general structure should work, but needs an extra condition added for the date start and end parameters.这个通用结构应该可以工作,但需要为日期开始和结束参数添加一个额外的条件。 I don't know that it makes sense to do that until you've cleared up the comment i made on your original post about mixed data types.在您清除我在您的原始帖子中关于混合数据类型的评论之前,我不知道这样做是否有意义。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM