我们如何在Google表格中使用筛选公式基于日期来提取文本列?

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

How do we pull text columns basis on the dates using filter formula in google sheets?

问题

我已在表格中创建了一个示例表,其中我希望每年或根据需要每月的活跃客户,这些客户一直存在,直到丢失,并且将在每个期间内计数,直到丢失。

我希望使用筛选公式或任何其他可以帮助解决Google表格查询的公式来填充这个表。

附上示例电子表格,其中黄色区域是期望的结果。

Google电子表格链接

我尝试了筛选公式,例如对于2022年:

=筛选(<Col a>, <colb>="<=2022-12-31",<Col D>="Live")

但这没有起作用,不清楚我们在2021年需要的逻辑。

英文:

I have created a sample table in the sheet where I want yearly, or if required monthly active clients which are recurring until they are lost and will be counted for each period until it gets lost.

I want to populate this using a filter formula or any other formula that might help solve the query in google sheets.

Attaching the sample spreadsheet to where the yellow area is the desired outcome.

https://docs.google.com/spreadsheets/d/1VIRp18HJyJ2UdfaHhaCpCHpfO6ctHW29TtP4iFJwYiU/edit#gid=0

I tried filter formula, for example for the year 2022

= filter(&lt;Col a&gt;, &lt;colb&gt;=&quot;&lt;=2022-12-31&quot;,&lt;Col D&gt;=&quot;Live&quot;)

which did not work and do not know the logic of where we will need it for the year 2021

答案1

得分: 1

You may try:

=let(Σ, map(B2:B, C2:C, D2:D, lambda(b, c, d, if(or(b="",d="Inactive"),,year(if(c="-",now(),c))-year(b)+1))),
Δ, {tocol(map(A2:A, Σ, lambda(a, z, if(a="",,wraprows(a, z, a)))), 3), tocol(map(B2:B, Σ, lambda(b, z, if(b="",,sequence(1, z, year(b), 1))), 3)},
bycol(torow(unique(index(Δ, , 2))), lambda(z, {z; filter(index(Δ, , 1), index(Δ, , 2) = z})))

英文:

You may try:

=let(Σ,map(B2:B,C2:C,D2:D,lambda(b,c,d,if(or(b=&quot;&quot;,d=&quot;Inactive&quot;),,year(if(c=&quot;-&quot;,now(),c))-year(b)+1))),
     Δ,{tocol(map(A2:A,Σ,lambda(a,z,if(a=&quot;&quot;,,wraprows(a,z,a)))),3),tocol(map(B2:B,Σ,lambda(b,z,if(b=&quot;&quot;,,sequence(1,z,year(b),1)))),3)},
       bycol(torow(unique(index(Δ,,2))),lambda(z,{z;filter(index(Δ,,1),index(Δ,,2)=z)})))

我们如何在Google表格中使用筛选公式基于日期来提取文本列?

huangapple
  • 本文由 发表于 2023年4月6日 20:33:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949576.html
匿名

发表评论

匿名网友

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

确定