Reputation: 6332
I have the following data (created through a ARRAYFORMULA
formula):
A | B | C | D | |
---|---|---|---|---|
1 | TRUE | TRUE | FALSE | TRUE |
2 | TRUE | TRUE | TRUE | TRUE |
3 | TRUE | FALSE | TRUE | TRUE |
If in a row all values are TRUE, the output for that row should be TRUE. If even 1 is FALSE, it should be FALSE instead. So a formula on the above table should output this:
E | |
---|---|
1 | FALSE |
2 | TRUE |
3 | FALSE |
ARRAYFORMULA
formula (not dragging a cell down, as this works badly when adding rows/columns at a later stage).AND
, but that gives only a single output:
=AND(A1:D3)
# FALSE
Also, AND doesn't work with ARRAYFORMULA
A *
function as AND in ARRAYFORMULA:
=ARRAYFORMULA(A1:A3*B1:B3*C1:C3)
Problems are:
A1:A3*C1:C3*D1:D3
instead of A1:A3*B1:B3*C1:C3*D1:D3
Unfortunately, this logic is not accepted:
=ARRAYFORMULA(A1:C3*)
Maybe a QUERY can provide this logic? But I'm not able to come up with how that query should look like.
How do I do a row-wise check if all values are TRUE with a single ARRAYFORMULA function (taking into account the restrictions mentioned)?
Upvotes: 2
Views: 2547
Reputation: 1
try:
=INDEX(REGEXMATCH(FLATTEN(QUERY(TRANSPOSE(B1:E3*1),,9^9)), "0")=FALSE)
Upvotes: 3