google sheet - 在二维数组中搜索值
google sheet - search for value in 2 dimension array
我正在 Google sheet 中创建甘特图。这是它的样子:
我手动添加图表而不使用任何公式。我把角色的名字和他活跃的几周的颜色排成一排。
现在我想为每个输入做一些资源管理计算,例如 "Backend" 角色,并填写 table 信息,如下所示:
was "Backend" active in month number 1 ? yes
How many weeks in month 1, "Backend" was active? 3
The address of "Backend's" start week: C6
The address of "Backend's" end week: E6
我可以使用公式而不是自定义函数来做到这一点吗?
Here is the link to my sheet.
=IF(COUNTIF(B3:E15, $D$20)>0, "是", "否")
=COUNTIF(B3:E15, D20)
这些将适用于您的前 2 列,我正在查看单元格地址公式,我自己也不知道!
第三列:
=ADDRESS(SUMPRODUCT((B:E=D)*ROW(B:E))/E22,(SUMPRODUCT((B:E=D)*COLUMN(B:E))-SUM(SEQUENCE(E22,1,0,1)))/E22,4)
第四列:
=ADDRESS(SUMPRODUCT((B:E=D)*ROW(B:E))/E22,(SUMPRODUCT((B:E=D)*COLUMN(B:E))-SUM(SEQUENCE(E22,1,0,1)))/E22+E22-1,4)
尝试:
=ARRAYFORMULA(IFNA(VLOOKUP(C22:C25,
QUERY(QUERY(IFERROR(SPLIT(FLATTEN(IF(B3:M15="backend", IF(B2:M2="",,
HLOOKUP(COLUMN(B1:M1), IF(B1:M1<>"", {COLUMN(B1:M1); B1:M1}), 2, 1))&"×"&1, )), "×")),
"select Col1,'yes',sum(Col2) where Col1 is not null group by Col1"),
"offset 1", 0), {2,3}, 0), {"no", 0}))
我正在 Google sheet 中创建甘特图。这是它的样子:
我手动添加图表而不使用任何公式。我把角色的名字和他活跃的几周的颜色排成一排。
现在我想为每个输入做一些资源管理计算,例如 "Backend" 角色,并填写 table 信息,如下所示:
was "Backend" active in month number 1 ? yes
How many weeks in month 1, "Backend" was active? 3
The address of "Backend's" start week: C6
The address of "Backend's" end week: E6
我可以使用公式而不是自定义函数来做到这一点吗? Here is the link to my sheet.
=IF(COUNTIF(B3:E15, $D$20)>0, "是", "否")
=COUNTIF(B3:E15, D20)
这些将适用于您的前 2 列,我正在查看单元格地址公式,我自己也不知道!
第三列:
=ADDRESS(SUMPRODUCT((B:E=D)*ROW(B:E))/E22,(SUMPRODUCT((B:E=D)*COLUMN(B:E))-SUM(SEQUENCE(E22,1,0,1)))/E22,4)
第四列:
=ADDRESS(SUMPRODUCT((B:E=D)*ROW(B:E))/E22,(SUMPRODUCT((B:E=D)*COLUMN(B:E))-SUM(SEQUENCE(E22,1,0,1)))/E22+E22-1,4)
尝试:
=ARRAYFORMULA(IFNA(VLOOKUP(C22:C25,
QUERY(QUERY(IFERROR(SPLIT(FLATTEN(IF(B3:M15="backend", IF(B2:M2="",,
HLOOKUP(COLUMN(B1:M1), IF(B1:M1<>"", {COLUMN(B1:M1); B1:M1}), 2, 1))&"×"&1, )), "×")),
"select Col1,'yes',sum(Col2) where Col1 is not null group by Col1"),
"offset 1", 0), {2,3}, 0), {"no", 0}))