用于 maxifs 的 Google Sheets Arrayformula [英] Google Sheets Arrayformula for maxifs

查看:31
本文介绍了用于 maxifs 的 Google Sheets Arrayformula的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

G'day 的人们,

我是长期的支持者/读者,但这是我第一次在 Stackoverflow 上发帖,所以请耐心等待.

G'day people,

I am a long time supporter/reader but this is my first time posting on Stackoverflow so please bear with me.

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. 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. 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. 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:

=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/

Kind Regards, Ben

解决方案

Here is a formula for you that can be placed in header cell (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, "")))
}

这篇关于用于 maxifs 的 Google Sheets Arrayformula的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆