T_AFM

=T_AFM(a,cl,cr,p)

a
array, regular or dynamic or table
cl
columns indexes as constant integers horizontal array, 2, or {2,3}
cr
criteria text strings or numeric arguments , horizontal array of criteria corresponding to columns indexes {">3","quad"}
p
only 1, the argument that carries the pattern array using boolean multiplication (AND) calculation.

creates pattern array, like "include" argument found in FILTER function of any array, for explicit criteria or comparative arguments, using boolean multiplication (AND)

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
860
Office Version
  1. 365
Platform
  1. 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.
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
ABCDEFGHIJKLMNOPQRSTUVWXYZ
101-01-20Tynia Malone500QuadMidWest12560.88dates between 2 and 4 jan, and revenue <500product not quad and not containing crested, and region not mexico
201-01-20Kiki Sho38YanakiMidWest902.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)
301-01-20Hien Pham500YanakiMidWest8035.6300
401-01-20Chantel Mims500YanakiWest8035.630=FILTER(A1:F32,H3#)1=FILTER(A1:F32,R3#)
501-01-20Tynia Malone39QuadEast1481.47002-01-20Hien Pham13SunsetMidWest337.35101-01-20Kiki Sho38YanakiMidWest902.79
601-01-20Kiki Sho48SunsetMidWest934.2003-01-20Chantel Mims7YanakiMexico188.65101-01-20Hien Pham500YanakiMidWest8035.63
701-01-20Hien Pham13QuadCanada580.97003-01-20Hien Pham5YanakiMexico139.75001-01-20Chantel Mims500YanakiWest8035.63
802-01-20Tynia Malone27YanakiNorthWest641.45004-01-20Tynia Malone3SunsetWest74.85101-01-20Kiki Sho48SunsetMidWest934.2
902-01-20Hien Pham13SunsetMidWest337.35004-01-20Hien Pham2YanakiSouth55.9002-01-20Tynia Malone27YanakiNorthWest641.45
1002-01-20Chantel Mims36SunsetMidWest732.87004-01-20Chantel Mims8Crested BeautSouth215.6102-01-20Hien Pham13SunsetMidWest337.35
1102-01-20Tynia Malone44QuadSouth1596.611102-01-20Chantel Mims36SunsetMidWest732.87
1203-01-20Hien Pham100Crested BeautMidWest1816.50combined103-01-20Chantel Mims450SunsetNorthWest6714.56
1303-01-20Chantel Mims7YanakiMexico188.650revenue>500 and product =Quad or Sunset004-01-20Hien Pham45SunsetCanada916.09
1403-01-20Hien Pham5YanakiMexico139.750=T_AFM(A1:F32,6,">500",1)*T_AFA(A1:F32,{4,4},{"quad","sunset"},0)004-01-20Tynia Malone3SunsetWest74.85
1503-01-20Chantel Mims37QuadMexico1374.0511004-01-20Hien Pham2YanakiSouth55.9
1603-01-20Janis Figueroa525QuadMexico13188.9210=FILTER(A1:F32,I15#)004-01-20Chantel Mims275YanakiWest4419.59
1703-01-20Chantel Mims450SunsetNorthWest6714.560001-01-20Tynia Malone500QuadMidWest12560.88005-01-20Hien Pham600YanakiEast9297.75
1804-01-20Hien Pham45SunsetCanada916.090001-01-20Tynia Malone39QuadEast1481.47005-01-20Janis Figueroa36Majestic BeautMidWest1069.47
1904-01-20Tynia Malone3SunsetWest74.850101-01-20Kiki Sho48SunsetMidWest934.2105-01-20Kiki Sho525YanakiMidWest8437.41
2004-01-20Chantel Mims48Crested BeautWest934.20101-01-20Hien Pham13QuadCanada580.97105-01-20Chantel Mims6Majestic BeautCanada209.7
2104-01-20Chantel Mims100Crested BeautMidWest1746.51102-01-20Chantel Mims36SunsetMidWest732.871
2204-01-20Hien Pham2YanakiSouth55.90002-01-20Tynia Malone44QuadSouth1596.610
2304-01-20Kiki Sho25QuadMexico907.160003-01-20Chantel Mims37QuadMexico1374.050
2404-01-20Chantel Mims8Crested BeautSouth215.61103-01-20Janis Figueroa525QuadMexico13188.921
2504-01-20Kiki Sho34Crested BeautMidWest778.860103-01-20Chantel Mims450SunsetNorthWest6714.560
2604-01-20Chantel Mims275YanakiWest4419.591004-01-20Hien Pham45SunsetCanada916.090
2705-01-20Chantel Mims200QuadEast5976.60004-01-20Kiki Sho25QuadMexico907.160
2805-01-20Hien Pham600YanakiEast9297.750005-01-20Chantel Mims200QuadEast5976.61
2905-01-20Janis Figueroa36Majestic BeautMidWest1069.470105-01-20Chantel Mims28QuadMidWest1039.820
3005-01-20Chantel Mims28QuadMidWest1039.82011
3105-01-20Kiki Sho525YanakiMidWest8437.41011
3205-01-20Chantel Mims6Majestic BeautCanada209.7010
33001
34001
350
360
371
380
390
400
411
420
430
441
450
460
47
T_AFM post
Cell Formulas
RangeFormula
H2,K16,I14,T4,K4,R2H2=FORMULATEXT(H3)
H3:H34H3=T_AFM(A1:F32,{1,1,6},{">1-jan-20","<5-jan-20","<500"},1)
R3:R34R3=T_AFM(A1:F32,{4,4,5},{"<>quad","<>crested*","<>mexico"},1)
K5:P10K5=FILTER(A1:F32,H3#)
T5:Y20T5=FILTER(A1:F32,R3#)
I15:I46I15=T_AFM(A1:F32,6,">500",1)*T_AFA(A1:F32,{4,4},{"quad","sunset"},0)
K17:P29K17=FILTER(A1:F32,I15#)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,827
Messages
6,181,200
Members
453,022
Latest member
RobertV1609

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top