Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Force =AND(<vector>,<vector>) to output a <vector>

How can I force a google sheets function like AND to perform its operation individually across each scalar index when it receives two vector inputs?

Seen below, NOT perfoms as expected with the addition of the ARRAYFORMULA function; however AND does not.

• Code

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

X1 X2 NOT(X1) AND(X1,X2) ARRAYFORMULA(NOT(X1)) ARRAYFORMULA(AND(X1,X2))
1 3 =NOT(A2:A6) =AND(A2:A6,B2:B6) =ARRAYFORMULA(NOT(A2:A6)) =ARRAYFORMULA(AND(A2:A6,B2:B6))
2 4
3 5
4 6
5 7

• Result

X1 X2 NOT(X1) AND(X1,X2) ARRAYFORMULA(NOT(X1)) ARRAYFORMULA(AND(X1,X2))
1 3 FALSE TRUE FALSE TRUE
2 4 FALSE
3 5 FALSE
4 6 FALSE
5 7 FALSE

>Solution :

You may try:

=map(A2:A6,B2:B6,lambda(a,b,and(a,b)))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading