Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 860
- Office Version
- 365
- Platform
- Windows
AAND , AOR !! recursive !! returns AND or OR values for each row of an array, calls APPEND2V
AAND:
AOR:
AAND:
Excel Formula:
=LAMBDA(ar,ns,
LET(s,IF(ns=0,"",ns),n,ROWS(ar),c,COLUMNS(ar),x,AND(INDEX(ar,n,)),
IF(n=1,INDEX(APPEND2V(x,s,),SEQUENCE(ROWS(s))),AAND(INDEX(ar,SEQUENCE(n-1),SEQUENCE(,c)),APPEND2V(x,s,)))
)
)
Excel Formula:
=LAMBDA(ar,ns,
LET(s,IF(ns=0,"",ns),n,ROWS(ar),c,COLUMNS(ar),x,OR(INDEX(ar,n,)),
IF(n=1,INDEX(APPEND2V(x,s,),SEQUENCE(ROWS(s))),AOR(INDEX(ar,SEQUENCE(n-1),SEQUENCE(,c)),APPEND2V(x,s,)))
)
)
LAMBDA 6.0.xlsx | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | |||
1 | sample | |||||||||||||
2 | a | b | c | |||||||||||
3 | ||||||||||||||
4 | x | 2 | y | 3 | ||||||||||
5 | A7 | =A2:D4="" | ||||||||||||
6 | find if there are full rows with null strings | =AAND(A7#,) | check | |||||||||||
7 | FALSE | FALSE | TRUE | FALSE | FALSE | FALSE | ||||||||
8 | TRUE | TRUE | TRUE | TRUE | TRUE | TRUE | ||||||||
9 | FALSE | FALSE | FALSE | FALSE | FALSE | FALSE | ||||||||
10 | =AOR(A7#,) | check | ||||||||||||
11 | find if we have at least 1 null string on each row | TRUE | TRUE | |||||||||||
12 | TRUE | TRUE | ||||||||||||
13 | any comparative operations | FALSE | FALSE | |||||||||||
14 | will be reflected by each row | |||||||||||||
15 | rows with at least one 0 value | any full row of 0 values? | ||||||||||||
16 | =NOT(AAND(A17:D19,)) | check | =NOT(AOR(A17:D19,)) | check | ||||||||||
17 | -2 | 0 | 1 | 3 | TRUE | FALSE | FALSE | TRUE | ||||||
18 | 0 | 0 | 0 | 0 | TRUE | FALSE | TRUE | FALSE | ||||||
19 | 1 | 2 | 3 | 4 | FALSE | FALSE | FALSE | TRUE | ||||||
20 | ||||||||||||||
21 | AOR(a,ns)=LAMBDA(ar,ns,LET(s,IF(ns=0,"",ns),….....,x,OR(INDEX(ar,n,)),IF(n=1,……..,AOR(INDEX(ar,SEQUENCE(n-1),SEQUENCE(,c)),APPEND2V(x,s,))))) | |||||||||||||
22 | to write AXOR we only have to add 3 letters | |||||||||||||
23 | AXOR(a,ns)=LAMBDA(ar,ns,LET(s,IF(ns=0,"",ns),…...,x,XOR(INDEX(ar,n,)),IF(n=1,…..,AXOR(INDEX(ar,SEQUENCE(n-1),SEQUENCE(,c)),APPEND2V(x,s,))))) | |||||||||||||
24 | ||||||||||||||
AAND,AOR post |
Cell Formulas | ||
---|---|---|
Range | Formula | |
B5 | B5 | =FORMULATEXT(A7) |
A7:D9 | A7 | =A2:D4="" |
F6,I16,F16,F10 | F6 | =FORMULATEXT(F7) |
F7:F9 | F7 | =AAND(A7#,) |
G7:G9 | G7 | =AND(A7:D7) |
F11:F13 | F11 | =AOR(A7#,) |
G11:G13 | G11 | =OR(A7:D7) |
F17:F19 | F17 | =NOT(AAND(A17:D19,)) |
I17:I19 | I17 | =NOT(AOR(A17:D19,)) |
G17:G19 | G17 | =AND(A17:D17,) |
J17:J19 | J17 | =OR(A17:D17) |
Dynamic array formulas. |
Last edited by a moderator:
Upvote
0