简体   繁体   English

用于 maxifs 的 Google 表格数组公式

[英]Google Sheets Arrayformula for maxifs

G'day people, G'day 人,

I am a long time supporter/reader but this is my first time posting on Stackoverflow so please bear with me.我是一个长期的支持者/读者,但这是我第一次在 Stackoverflow 上发帖,所以请多多包涵。

Example of the Sheet I am working in我正在使用的工作表示例

=if(E2="",,If(maxifs($E:$E,$K:$K,K2)=E2,K2,""))

I am a little stumped on converting this maxifs formula above that I am trying to convert to an arrayformula in Google Sheets.我在转换上面的这个 maxifs 公式时有点难过,我正试图在 Google Sheets 中转换为数组公式。 This formula checks to ensure E2 (timestamp) is not blank and then compares then looks all over the timestamp column for a newer timestamp for a distinct identifier (Column K example: '43909Ben Johns' (a CONCAT of a reference number and a client)) to see if there is a new version of that identifier.此公式检查以确保 E2(时间戳)不为空,然后进行比较,然后在整个时间戳列中查找不同标识符的较新时间戳(列 K 示例:'43909Ben Johns'(参考号和客户的 CONCAT) ) 查看是否有该标识符的新版本。 if it cannot find it, it will populate the row with the latest in column L (where the formula is situated) with the same identifier that is in Column K on the same row.如果找不到它,它将使用与同一行的 K 列中相同的标识符填充 L 列(公式所在的位置)中最新的行。 If it does find a newer version it will populate with "".如果它确实找到了更新的版本,它将填充“”。

I tried setting up an arrayformula however I could see that it wouldn't work as I was trying to convert it.我尝试设置一个数组公式,但是我可以看到它在我尝试转换它时不起作用。 It calculated the first row but left all other rows (about 10,000) blank and I suspect that is because it is trying to compare data on E2 and K2 with other rows in column E and K. Below is the array formula I tried:它计算了第一行,但将所有其他行(大约 10,000 行)留空,我怀疑这是因为它试图将 E2 和 K2 上的数据与 E 和 K 列中的其他行进行比较。下面是我尝试的数组公式:

=arrayformula(if(E2:E="",,If(maxifs(E2:E,K2:K,K2:K)=E2:E,K2:K,"")))

Any help to untangle this would be appreciated and if you need me to explain further, please let me know.任何有助于解决这个问题的帮助将不胜感激,如果您需要我进一步解释,请告诉我。

EDIT: Added Sample of Sheet https://docs.google.com/spreadsheets/d/1k1qK2BuYOwDPCtHedg7zV72JmE3_TQYu9EBwZVogQbU/编辑:添加了表格https://docs.google.com/spreadsheets/d/1k1qK2BuYOwDPCtHedg7zV72JmE3_TQYu9EBwZVogQbU/的样本

Kind Regards, Ben亲切的问候,本

Here is a formula for you that can be placed in header cell ( L1 ):这是一个公式,可以放在 header 单元格( L1 )中:

={
  "Valid Check (Most Recent)";
  ARRAYFORMULA(IF(E2:E = "",, IF(E2:E = VLOOKUP(K2:K, SORT({K2:K, E2:E}, 2, False), 2, 0), K2:K, "")))
}

在此处输入图像描述

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

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