Data&Time Max group B

huangapple go评论55阅读模式
英文:

Query: Data&Time Max group B

问题

09/02/2023, 13:30:01 MARIO
09/02/2023, 14:04:57 LUCA

英文:

I have the following data and I need to derive the max date (date and time) A for group B in google sheets.

A                       B
09/02/2023, 11:37:44	MARIO
09/02/2023, 11:42:41	MARIO
09/02/2023, 11:48:03	LUCA
09/02/2023, 13:03:06	LUCA
09/02/2023, 13:08:24	MARIO
09/02/2023, 13:15:57	LUCA
09/02/2023, 13:20:25	MARIO
09/02/2023, 13:23:38	MARIO
09/02/2023, 13:30:01	MARIO
09/02/2023, 13:33:36	LUCA
09/02/2023, 13:38:41	LUCA
09/02/2023, 13:41:38	LUCA
09/02/2023, 13:58:50	LUCA
09/02/2023, 14:04:57	LUCA

OUTPUT
09/02/2023, 13:30:01	MARIO
09/02/2023, 14:04:57	LUCA

=Query(Dati!A1:M,"Select B, Max(A) where B <> '' group by B label max(A) ''",0)

No MAX

答案1

得分: 1

尝试在运行查询之前移除逗号:

=ArrayFormula(Query({SUBSTITUTE(A1:A,"","),B1:B},"Select Col2, Max(Col1) where Col2 <> '' group by Col2 label max(Col1) ''",0))
英文:

Try to remove the commas before running the QUERY:

=ArrayFormula(Query({SUBSTITUTE(A1:A,&quot;,&quot;,),B1:B},&quot;Select Col2, Max(Col1) where Col2 &lt;&gt; &#39;&#39; group by Col2 label max(Col1) &#39;&#39;&quot;,0))

huangapple
  • 本文由 发表于 2023年2月18日 02:02:28
  • 转载请务必保留本文链接:https://go.coder-hub.com/75487802.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定