Google 张表格使用数组公式填充空白

Google sheets fill in the gaps using array formula

我有这个 table,如果日期相同,日期列会有一些空白。 即 B3:B6 都是 31/01/2022 我想用F列来填补空白。

我想在单元格 F2 中使用数组公式,当相对 A 为空时它停止 即如果A279为空,F279也为空

我尝试使用非数组解决方案来做到这一点 =IF(B2="",F1,B2)

而且我无法将其更改为数组一 =ArrayFormula(IF(B2:B="",F1,B2:B))

我不知道如何使 F1 动态化,行号总是比 B 少一,比如 B3 显示 F2,B4 显示 F3

This is the Sheet

在 F2 中尝试

=ArrayFormula(lookup(row(A2:A),row(A2:A)/--(B2:B<>""),B2:B))

或(更好)在 F1

={"Date";ArrayFormula(if(A2:A="",,lookup(row(A2:A),row(A2:A)/--(B2:B<>""),B2:B)))}

要了解它是如何工作的,请填写例如 I2 =arrayformula(if(A2:A="",,row(A2:A)/--(B2:B<>""))) ...如果 Bx 为空,我们会得到一个错误,在这种情况下查找将采用以前的值而不会出错。