问题
I'm looking for some help with this little code that I'm using in Google spreadsheet:
=ArrayFormula(IF(OR(F2:F="Cancelled",G2:G="Cancelled"),"Cancelled",IF(F2:F="Finished",20,)+IF(G2:G="Finished",20,)))
For some reason it works if I use this code without calling multiple rows:
=ArrayFormula(IF(OR(F2="Cancelled",G2="Cancelled"),"Cancelled",IF(F2="Finished",20,)+IF(G2="Finished",20,)))
Does anyone have an idea which is the correct way to use it?
Thanks in advance.
回答1:
OR
merges all TRUE
s to one value and does not maintain array size.
You need to use +
instead of OR
; Like,
=ARRAYFORMULA(IF((F2:F="Cancelled")+(G2:G="Cancelled"), "Cancelled".... ))
来源:https://stackoverflow.com/questions/46591324/how-to-nest-if-block-with-or-statement-in-google-spreadsheet