In Google Sheets, when using ArrayFormula with AND formula, I don't get the results as it should be.
A|B
2|7
In C1
I put formula as: =and(A1>5,B1>6)
then I get True
. If in D1 I put formula as: =ArrayFormula(and(A1:A>5,B1:B>6))
I get the results as False
.
Here are my two questions:
ArrayFormula
not repeated for all cells in the column?true
without ArrayFormula
and False
with Arrayformula
?AND
doesn't work with that way with Array formulae because it AND
s the whole array together in the top left cell of the regardless of number of dimensions.
I.e. it checks if "">""
which is FALSE
, AND
ed with anything it will return FALSE
for the top left cell, that result is carried down.
You can use multiplication of truth values to create AND
ing that works with ARRAYFORMULA
like this:
=ArrayFormula((A1:A>1)*(B1:B>6) = 1)
The OR
equivalent would obviously be
=ArrayFormula((A1:A>1)+(B1:B>6) > 0)