多个依赖于日期、结果和重复名称的条件

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

Multiple conditions that depend on date, result and repeated names

问题

寻找一个公式/数组,当满足以下条件时,在列D中会"写入一个"x"":

  1. 日期早于列A中的日期
  2. 文本与列B中的相同
  3. 列C中的最后一个值是"1"(对于与B列中的名称相同的行)

例如:如果在4.11日,Eugene在列C中有一个"1",那么4.10日的列D应该有一个"x",否则为空白...

一旦Joey获得一个"1"的结果,所有之前的日期都应该变成"x"... 基本上,在最后一个"1"之前的Joey的一切都应该自动变成"x"。

链接

Date	Name	Result	 Reset Fx 
4.10	Eugene	0	 FALSE 
4.10	Joey	0	 FALSE 
4.11	Eugene	1	 x 
4.11	Joey	0	 FALSE 
4.12	Joey	0	 FALSE 
4.15	Joey	0	 FALSE 
4.18	Joey	0	 FALSE 
4.18	Joey	0	 FALSE 
4.19	Joey	0	 FALSE 
4.21	Joey	1	 x 
4.22	Tony	0	 FALSE 
4.22	Joey	0	 FALSE 
4.23	Andy	0	 FALSE 
4.23	Andy	0	 FALSE 
4.23	Tony	0	 FALSE 
4.24	Tony	0	 FALSE 
4.24	Tony	0	 FALSE 
4.24	Andy	0	 FALSE 
4.24	Andy	1	 x 
4.25	Tony	0	 FALSE 
4.25	Andy	0	 FALSE 
4.25	Andy	0	 FALSE 
4.25	Andy	0	 FALSE 
4.25	Eugene	0	 FALSE 
4.25	Eugene	0	 FALSE 

我尝试过数组、if、ifs、if w等方法...
我卡在尝试获取重复的名称和之前的日期以在不同的单元格中获得结果。

英文:

Looking for a formula/array that will "write an "x"" in column D when the following conditions occur:

  1. date is prior to date in column A
  2. text is the same as in column B
  3. the last value in column C is "1" (on rows that have the same name as B)

For example: If on 4.11, Eugene has a "1" in Column C, then then column D for 4.10 should have an "x", otherwise it would be blank...

As soon as Joey gets a "1" as a result, all the previous dates should become "x"... pretty much everything for Joey before the last "1" should automatically be "x".

https://docs.google.com/spreadsheets/d/1lhL7w411XkgZpXpBTphy1yIioVPlYfSJBRXAdTTH-4s/edit?usp=sharing

Date	Name	Result	 Reset Fx 
4.10	Eugene	0	 FALSE 
4.10	Joey	0	 FALSE 
4.11	Eugene	1	 x 
4.11	Joey	0	 FALSE 
4.12	Joey	0	 FALSE 
4.15	Joey	0	 FALSE 
4.18	Joey	0	 FALSE 
4.18	Joey	0	 FALSE 
4.19	Joey	0	 FALSE 
4.21	Joey	1	 x 
4.22	Tony	0	 FALSE 
4.22	Joey	0	 FALSE 
4.23	Andy	0	 FALSE 
4.23	Andy	0	 FALSE 
4.23	Tony	0	 FALSE 
4.24	Tony	0	 FALSE 
4.24	Tony	0	 FALSE 
4.24	Andy	0	 FALSE 
4.24	Andy	1	 x 
4.25	Tony	0	 FALSE 
4.25	Andy	0	 FALSE 
4.25	Andy	0	 FALSE 
4.25	Andy	0	 FALSE 
4.25	Eugene	0	 FALSE 
4.25	Eugene	0	 FALSE 

I have tried arrays, if, ifs, if w and...
I get stuck trying to get the repeated name and the prior dates to get a result in a different cell.

答案1

得分: 0

=如果我正确理解了问题,您希望在被标记为1的日期之前,使列D对于每个姓名的每个实例都是x。我解决了这个问题,假设1只会被输入到每个姓名的一个日期中。我使用了匹配、索引和筛选的组合来确定每个姓名哪个日期有1,并将该日期和姓名用作之前日期的参考。希望对您有所帮助!

英文:

If I am understanding the question correctly, you want column D to be x for every instance of a name before the date it is marked as 1. I solved it assuming that 1 would only be input for only one date for each name. I used a combination of match, index, and filter to determine which date had the 1 for each name and use that date and name as a reference for the prior date. Hope this helps!

=IFERROR(IF(AND(B2=(INDEX(FILTER($B:$B,$B:$B=B2,0),MATCH(1,FILTER($C:$C,$B:$B=B2,0),0),1)),
A2<=(INDEX(FILTER($A:$A,$B:$B=B2,0),MATCH(1,FILTER($C:$C,$B:$B=B2,0),0),1))),"x",""),"")

答案2

得分: 0

我已经弄清楚了。你们帮我找到了正确的方法。

=iferror(if(A2<=index(filter($A$2:$A,$C$2:$C=1,$B$2:$B=$B2),sumproduct(--($C$2:C=1),--($B$2:$B=$B2))), "x", ""), "")

我必须拖动它下去,因为它不能作为arrayformula工作,但它确实满足我的需求。
示例表格显示了结果。

英文:

I figured it out. You guys got me on the right track.

=iferror(if(A2<=index(filter($A$2:$A,$C$2:$C=1,$B$2:$B=$B2),sumproduct(--($C$2:C=1),--($B$2:$B=$B2))),"x",""),"")

I have to drag it down because it won't work as arrayformula, but it does what I need.
The example sheet shows the results.

huangapple
  • 本文由 发表于 2023年6月1日 06:37:14
  • 转载请务必保留本文链接:https://go.coder-hub.com/76377696.html
匿名

发表评论

匿名网友

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

确定