[英]Google sheets transform if statement into arrayformula
How do you transform the below into an arrayformula that drags down according to all BA column and N column?你如何将下面的内容转换为根据所有 BA 列和 N 列向下拖动的数组公式?
= IFS( ISBLANK($AD$2), IFS(N3="April 2020",(BA3/60)*$AD$3, N3="May 2020",(BA3/60)*$AD$4, N3="June 2020",(BA3/60)*$AD$5, N3="July 2020",(BA3/60)*$AD$6, N3="August 2020",(BA3/60)*$AD$7, N3="September 2020",(BA3/60)*$AD$8,N3="October 2020",(BA3/60)*$AD$9,N3="November 2020",(BA3/60)*$AD$10,N3="December 2020",(BA3/60)*$AD$11), NOT (ISBLANK($AD$2)), (BA3/60)*$AD$2)
https://docs.google.com/spreadsheets/d/1Z6d8SbFc5iO07pYgiudI9CR84PrwUWc5Q5wQpWKLWFc/edit#gid=0 It is the formula in cell F2 https://docs.google.com/spreadsheets/d/1Z6d8SbFc5iO07pYgiudI9CR84PrwUWc5Q5wQpWKLWFc/edit#gid=0它是单元格F2中的公式
Does this work for you?这对你有用吗?
= ArrayFormula(IF( ISBLANK($AE$2),
IF(O2:O="April 2020", (AJ2:AJ/60)*$AE$3,
IF(O2:O="May 2020", (AJ2:AJ/60)*$AE$4,
IF(O2:O="June 2020", (AJ2:AJ/60)*$AE$5,
IF(O2:O="July 2020", (AJ2:AJ/60)*$AE$6,
IF(O2:O="August 2020", (AJ2:AJ/60)*$AE$7,
IF(O2:O="September 2020", (AJ2:AJ/60)*$AE$8,
IF(O2:O="October 2020", (AJ2:AJ/60)*$AE$9,
IF(O2:O="November 2020", (AJ2:AJ/60)*$AE$10,
IF(O2:O="December 2020", (AJ2:AJ/60)*$AE$11))))))))),
(AJ2:AJ/60)*$AE$2))
Let us know if that does what you want...让我们知道这是否符合您的要求...
The formula is in G2 of the added column shown below.公式在下面显示的添加列的 G2 中。
UPDATE: Since I had inserted a column, to demonstrate that this formula gave the exact same answers as your formulas in column F, the ranges were offset.更新:因为我插入了一列,为了证明这个公式给出了与 F 列中的公式完全相同的答案,范围被偏移了。 Here is the same formula corrected for placement in F2.
这是针对 F2 中的放置更正的相同公式。
= ArrayFormula(IF( ISBLANK($AD$2),
IF(N2:N="April 2020", (AI2:AI/60)*$AD$3,
IF(N2:N="May 2020", (AI2:AI/60)*$AD$4,
IF(N2:N="June 2020", (AI2:AI/60)*$AD$5,
IF(N2:N="July 2020", (AI2:AI/60)*$AD$6,
IF(N2:N="August 2020", (AI2:AI/60)*$AD$7,
IF(N2:N="September 2020", (AI2:AI/60)*$AD$8,
IF(N2:N="October 2020", (AI2:AI/60)*$AD$9,
IF(N2:N="November 2020", (AI2:AI/60)*$AD$10,
IF(N2:N="December 2020", (AI2:AI/60)*$AD$11))))))))),
(AI2:AI/60)*$AD$2))
UPDATE#2:更新#2:
I have added a tab to your sheet, Calendar-GK.我在您的工作表 Calendar-GK 中添加了一个选项卡。 Cell F1 has the final formula, which includes the header title, and is the following now:
单元格 F1 具有最终公式,其中包括 header 标题,现在如下所示:
={"Money";ArrayFormula(IF( ISBLANK($AD$2),
IF(N2:N="April 2020", (AI2:AI/60)*$AD$3,
IF(N2:N="May 2020", (AI2:AI/60)*$AD$4,
IF(N2:N="June 2020", (AI2:AI/60)*$AD$5,
IF(N2:N="July 2020", (AI2:AI/60)*$AD$6,
IF(N2:N="August 2020", (AI2:AI/60)*$AD$7,
IF(N2:N="September 2020", (AI2:AI/60)*$AD$8,
IF(N2:N="October 2020", (AI2:AI/60)*$AD$9,
IF(N2:N="November 2020", (AI2:AI/60)*$AD$10,
IF(N2:N="December 2020", (AI2:AI/60)*$AD$11))))))))),
(AI2:AI/60)*$AD$2))}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.