NumesSanguis
NumesSanguis

Reputation: 6332

Google sheets - Check all TRUE per row in boolean 2D array with ARRAYFORMULA

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

Restrictions

What I tried

AND

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:C3*

Unfortunately, this logic is not accepted:

=ARRAYFORMULA(A1:C3*)

QUERY

Maybe a QUERY can provide this logic? But I'm not able to come up with how that query should look like.

Question

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

Answers (1)

player0
player0

Reputation: 1

try:

=INDEX(REGEXMATCH(FLATTEN(QUERY(TRANSPOSE(B1:E3*1),,9^9)), "0")=FALSE)

enter image description here

Upvotes: 3

Related Questions