0

I.e., if I have:

A B
TRUE TRUE
TRUE FALSE
FALSE TRUE
FALSE FALSE

say I want to create a column C that is A OR B:

A B C
TRUE TRUE TRUE
TRUE FALSE TRUE
FALSE TRUE TRUE
FALSE FALSE FALSE

Is this possible with ARRAYFORMULA or some other method which automatically creates a RANGE of values, without having to rely on auto-filling to increment a single column?

i.e., I'd like to do:

=ARRAYFORMULA(OR(A:A, B:B))

but since OR can take array inputs, the result of OR(A:A, B:B) is the single value TRUE, and the ARRAYFORMULA is also TRUE.

1 Answer 1

1

I figured out a workaround, by treating Booleans as integers.

For OR:

=ARRAYFORMULA(A:A + B:B>0)

For AND:

=ARRAYFORMULA(A:A * B:B>0)

Would be interested to know if there's a more elegant solution, though.

1
  • "Would be interested to know if there's a more elegant solution, though..." There isn't a more elegant solution. That's the commonly accepted way to accomplish what you want. ;)
    – ztiaa
    Mar 27 at 23:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.