Xlambda
Well-known Member
- Joined
- Mar 8, 2021
- Messages
- 860
- Office Version
- 365
- Platform
- Windows
T_AFM !! recursive !! Tool Advanced Filter boolean Multiplication (AND), creates pattern array, like "include" argument found in FILTER function of any array, for explicit criteria or comparative arguments.
Main function used is countifs and not filter, because it can handle explicit comparative arguments.
Can be used inside FILTER function as "include" argument or with ADVFLT (AdvancedFilter) function.
Main function used is countifs and not filter, because it can handle explicit comparative arguments.
Can be used inside FILTER function as "include" argument or with ADVFLT (AdvancedFilter) function.
Excel Formula:
=LAMBDA(a,cl,cr,p,
LET(n,COLUMNS(cl),x,INDEX(cl,n),y,INDEX(cr,n),z,INDEX(a,,x),
IF(n=1,p*(COUNTIFS(z,z,z,y)>0),p*T_AFM(a,INDEX(cl,SEQUENCE(,n-1)),INDEX(cr,SEQUENCE(,n-1)),COUNTIFS(z,z,z,y)>0))
)
)
LAMBDA 7.0.xlsx | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | |||
1 | 01-01-20 | Tynia Malone | 500 | Quad | MidWest | 12560.88 | dates between 2 and 4 jan, and revenue <500 | product not quad and not containing crested, and region not mexico | ||||||||||||||||||||
2 | 01-01-20 | Kiki Sho | 38 | Yanaki | MidWest | 902.79 | =T_AFM(A1:F32,{1,1,6},{">1-jan-20","<5-jan-20","<500"},1) | =T_AFM(A1:F32,{4,4,5},{"<>quad","<>crested*","<>mexico"},1) | ||||||||||||||||||||
3 | 01-01-20 | Hien Pham | 500 | Yanaki | MidWest | 8035.63 | 0 | 0 | ||||||||||||||||||||
4 | 01-01-20 | Chantel Mims | 500 | Yanaki | West | 8035.63 | 0 | =FILTER(A1:F32,H3#) | 1 | =FILTER(A1:F32,R3#) | ||||||||||||||||||
5 | 01-01-20 | Tynia Malone | 39 | Quad | East | 1481.47 | 0 | 02-01-20 | Hien Pham | 13 | Sunset | MidWest | 337.35 | 1 | 01-01-20 | Kiki Sho | 38 | Yanaki | MidWest | 902.79 | ||||||||
6 | 01-01-20 | Kiki Sho | 48 | Sunset | MidWest | 934.2 | 0 | 03-01-20 | Chantel Mims | 7 | Yanaki | Mexico | 188.65 | 1 | 01-01-20 | Hien Pham | 500 | Yanaki | MidWest | 8035.63 | ||||||||
7 | 01-01-20 | Hien Pham | 13 | Quad | Canada | 580.97 | 0 | 03-01-20 | Hien Pham | 5 | Yanaki | Mexico | 139.75 | 0 | 01-01-20 | Chantel Mims | 500 | Yanaki | West | 8035.63 | ||||||||
8 | 02-01-20 | Tynia Malone | 27 | Yanaki | NorthWest | 641.45 | 0 | 04-01-20 | Tynia Malone | 3 | Sunset | West | 74.85 | 1 | 01-01-20 | Kiki Sho | 48 | Sunset | MidWest | 934.2 | ||||||||
9 | 02-01-20 | Hien Pham | 13 | Sunset | MidWest | 337.35 | 0 | 04-01-20 | Hien Pham | 2 | Yanaki | South | 55.9 | 0 | 02-01-20 | Tynia Malone | 27 | Yanaki | NorthWest | 641.45 | ||||||||
10 | 02-01-20 | Chantel Mims | 36 | Sunset | MidWest | 732.87 | 0 | 04-01-20 | Chantel Mims | 8 | Crested Beaut | South | 215.6 | 1 | 02-01-20 | Hien Pham | 13 | Sunset | MidWest | 337.35 | ||||||||
11 | 02-01-20 | Tynia Malone | 44 | Quad | South | 1596.61 | 1 | 1 | 02-01-20 | Chantel Mims | 36 | Sunset | MidWest | 732.87 | ||||||||||||||
12 | 03-01-20 | Hien Pham | 100 | Crested Beaut | MidWest | 1816.5 | 0 | combined | 1 | 03-01-20 | Chantel Mims | 450 | Sunset | NorthWest | 6714.56 | |||||||||||||
13 | 03-01-20 | Chantel Mims | 7 | Yanaki | Mexico | 188.65 | 0 | revenue>500 and product =Quad or Sunset | 0 | 04-01-20 | Hien Pham | 45 | Sunset | Canada | 916.09 | |||||||||||||
14 | 03-01-20 | Hien Pham | 5 | Yanaki | Mexico | 139.75 | 0 | =T_AFM(A1:F32,6,">500",1)*T_AFA(A1:F32,{4,4},{"quad","sunset"},0) | 0 | 04-01-20 | Tynia Malone | 3 | Sunset | West | 74.85 | |||||||||||||
15 | 03-01-20 | Chantel Mims | 37 | Quad | Mexico | 1374.05 | 1 | 1 | 0 | 04-01-20 | Hien Pham | 2 | Yanaki | South | 55.9 | |||||||||||||
16 | 03-01-20 | Janis Figueroa | 525 | Quad | Mexico | 13188.92 | 1 | 0 | =FILTER(A1:F32,I15#) | 0 | 04-01-20 | Chantel Mims | 275 | Yanaki | West | 4419.59 | ||||||||||||
17 | 03-01-20 | Chantel Mims | 450 | Sunset | NorthWest | 6714.56 | 0 | 0 | 01-01-20 | Tynia Malone | 500 | Quad | MidWest | 12560.88 | 0 | 05-01-20 | Hien Pham | 600 | Yanaki | East | 9297.75 | |||||||
18 | 04-01-20 | Hien Pham | 45 | Sunset | Canada | 916.09 | 0 | 0 | 01-01-20 | Tynia Malone | 39 | Quad | East | 1481.47 | 0 | 05-01-20 | Janis Figueroa | 36 | Majestic Beaut | MidWest | 1069.47 | |||||||
19 | 04-01-20 | Tynia Malone | 3 | Sunset | West | 74.85 | 0 | 1 | 01-01-20 | Kiki Sho | 48 | Sunset | MidWest | 934.2 | 1 | 05-01-20 | Kiki Sho | 525 | Yanaki | MidWest | 8437.41 | |||||||
20 | 04-01-20 | Chantel Mims | 48 | Crested Beaut | West | 934.2 | 0 | 1 | 01-01-20 | Hien Pham | 13 | Quad | Canada | 580.97 | 1 | 05-01-20 | Chantel Mims | 6 | Majestic Beaut | Canada | 209.7 | |||||||
21 | 04-01-20 | Chantel Mims | 100 | Crested Beaut | MidWest | 1746.5 | 1 | 1 | 02-01-20 | Chantel Mims | 36 | Sunset | MidWest | 732.87 | 1 | |||||||||||||
22 | 04-01-20 | Hien Pham | 2 | Yanaki | South | 55.9 | 0 | 0 | 02-01-20 | Tynia Malone | 44 | Quad | South | 1596.61 | 0 | |||||||||||||
23 | 04-01-20 | Kiki Sho | 25 | Quad | Mexico | 907.16 | 0 | 0 | 03-01-20 | Chantel Mims | 37 | Quad | Mexico | 1374.05 | 0 | |||||||||||||
24 | 04-01-20 | Chantel Mims | 8 | Crested Beaut | South | 215.6 | 1 | 1 | 03-01-20 | Janis Figueroa | 525 | Quad | Mexico | 13188.92 | 1 | |||||||||||||
25 | 04-01-20 | Kiki Sho | 34 | Crested Beaut | MidWest | 778.86 | 0 | 1 | 03-01-20 | Chantel Mims | 450 | Sunset | NorthWest | 6714.56 | 0 | |||||||||||||
26 | 04-01-20 | Chantel Mims | 275 | Yanaki | West | 4419.59 | 1 | 0 | 04-01-20 | Hien Pham | 45 | Sunset | Canada | 916.09 | 0 | |||||||||||||
27 | 05-01-20 | Chantel Mims | 200 | Quad | East | 5976.6 | 0 | 0 | 04-01-20 | Kiki Sho | 25 | Quad | Mexico | 907.16 | 0 | |||||||||||||
28 | 05-01-20 | Hien Pham | 600 | Yanaki | East | 9297.75 | 0 | 0 | 05-01-20 | Chantel Mims | 200 | Quad | East | 5976.6 | 1 | |||||||||||||
29 | 05-01-20 | Janis Figueroa | 36 | Majestic Beaut | MidWest | 1069.47 | 0 | 1 | 05-01-20 | Chantel Mims | 28 | Quad | MidWest | 1039.82 | 0 | |||||||||||||
30 | 05-01-20 | Chantel Mims | 28 | Quad | MidWest | 1039.82 | 0 | 1 | 1 | |||||||||||||||||||
31 | 05-01-20 | Kiki Sho | 525 | Yanaki | MidWest | 8437.41 | 0 | 1 | 1 | |||||||||||||||||||
32 | 05-01-20 | Chantel Mims | 6 | Majestic Beaut | Canada | 209.7 | 0 | 1 | 0 | |||||||||||||||||||
33 | 0 | 0 | 1 | |||||||||||||||||||||||||
34 | 0 | 0 | 1 | |||||||||||||||||||||||||
35 | 0 | |||||||||||||||||||||||||||
36 | 0 | |||||||||||||||||||||||||||
37 | 1 | |||||||||||||||||||||||||||
38 | 0 | |||||||||||||||||||||||||||
39 | 0 | |||||||||||||||||||||||||||
40 | 0 | |||||||||||||||||||||||||||
41 | 1 | |||||||||||||||||||||||||||
42 | 0 | |||||||||||||||||||||||||||
43 | 0 | |||||||||||||||||||||||||||
44 | 1 | |||||||||||||||||||||||||||
45 | 0 | |||||||||||||||||||||||||||
46 | 0 | |||||||||||||||||||||||||||
47 | ||||||||||||||||||||||||||||
T_AFM post |
Cell Formulas | ||
---|---|---|
Range | Formula | |
H2,K16,I14,T4,K4,R2 | H2 | =FORMULATEXT(H3) |
H3:H34 | H3 | =T_AFM(A1:F32,{1,1,6},{">1-jan-20","<5-jan-20","<500"},1) |
R3:R34 | R3 | =T_AFM(A1:F32,{4,4,5},{"<>quad","<>crested*","<>mexico"},1) |
K5:P10 | K5 | =FILTER(A1:F32,H3#) |
T5:Y20 | T5 | =FILTER(A1:F32,R3#) |
I15:I46 | I15 | =T_AFM(A1:F32,6,">500",1)*T_AFA(A1:F32,{4,4},{"quad","sunset"},0) |
K17:P29 | K17 | =FILTER(A1:F32,I15#) |
Dynamic array formulas. |
Upvote
0