This ArrayFormula works:
=ArrayFormula(IF(ISBLANK(F:F); ""; E:E*G:G))
(it does a simple calculation and fill with it all the rows that are not empty)
This formula also works:
=(E1/$J$1*G1) ((1-(E1/$J$1))*$K$1)
(it does a calculation for a weighted sort)
But the ArrayFormula version of that last formula doesn't work as expected:
=ArrayFormula(IF(B:B=""; ""; (E1/$J$1*G1) ((1-(E1/$J$1))*$K$1)))
It doesn't give an error and it fills the correct rows, but it shows a 1 as a result for all rows (not the correct result, only one of the rows should show the 1).
Any ideas of what could be happening or how to solve it?
Thanks!
CodePudding user response:
Nevermind, I've just found out the solution. The references to specific cells (e.g. E1) should be to an entire column (e.g. E:E) if I want the ArrayFormula to work as I want.
CodePudding user response:
use:
=ARRAYFORMULA(IF(B:B="";; (E:E/J1*G:G) ((1-(E:E/J1))*K1)))