将公式转换为arrayformula

时间:2019-05-21 18:48:13

标签: if-statement google-sheets array-formulas google-sheets-formula

如何将此公式重写为数组公式变量?

=IF(ISBLANK(D4),"",IF(AND(D4="Long", G4<=E4), "No trade", IF(AND(D4="Short", G4>=E4), "No trade", IF(AND(I4>=E4, H4<=E4), "Target Hit", "Active")))) 

1 个答案:

答案 0 :(得分:0)

这是数组公式:

=ARRAYFORMULA(IF(ISBLANK(D4:D), ,
 IF((D4:D="Long") * (G4:G<=E4:E), "No trade", 
 IF((D4:D="Short") * (G4:G>=E4:E), "No trade", 
 IF((I4:I>=E4:E) * (H4:H<=E4:E), "Target Hit", "Active")))))