T_AFA

=T_AFA(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 0 or ignored, the argument that carries the pattern array using boolean adding (OR) calculation.

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

Xlambda

Well-known Member
Joined
Mar 8, 2021
Messages
832
Office Version
  1. 365
Platform
  1. Windows
T_AFA !! recursive !! Tool Advanced Filter boolean Adding (OR), 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_AFA(a,INDEX(cl,SEQUENCE(,n-1)),INDEX(cr,SEQUENCE(,n-1)),COUNTIFS(z,z,z,y)>0))
    )
)
LAMBDA 7.0.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXY
101-01-20Tynia Malone500QuadMidWest12560.88product="Quad" or region="West"product="Quad" or region contains "West"
201-01-20Kiki Sho38YanakiMidWest902.79=T_AFA(A1:F32,{5,4},{"west","quad"},)=T_AFA(A1:F32,{4,5},{"quad","*west"},0)
301-01-20Hien Pham500YanakiMidWest8035.6312
401-01-20Chantel Mims500YanakiWest8035.630=FILTER(A1:F32,H3#)1=FILTER(A1:F32,Q3#)
501-01-20Tynia Malone39QuadEast1481.47001-01-20Tynia Malone500QuadMidWest12560.88101-01-20Tynia Malone500QuadMidWest12560.88
601-01-20Kiki Sho48SunsetMidWest934.2101-01-20Chantel Mims500YanakiWest8035.63101-01-20Kiki Sho38YanakiMidWest902.79
701-01-20Hien Pham13QuadCanada580.97101-01-20Tynia Malone39QuadEast1481.47101-01-20Hien Pham500YanakiMidWest8035.63
802-01-20Tynia Malone27YanakiNorthWest641.45001-01-20Hien Pham13QuadCanada580.97101-01-20Chantel Mims500YanakiWest8035.63
902-01-20Hien Pham13SunsetMidWest337.35102-01-20Tynia Malone44QuadSouth1596.61101-01-20Tynia Malone39QuadEast1481.47
1002-01-20Chantel Mims36SunsetMidWest732.87003-01-20Chantel Mims37QuadMexico1374.05101-01-20Kiki Sho48SunsetMidWest934.2
1102-01-20Tynia Malone44QuadSouth1596.61003-01-20Janis Figueroa525QuadMexico13188.92101-01-20Hien Pham13QuadCanada580.97
1203-01-20Hien Pham100Crested BeautMidWest1816.5004-01-20Tynia Malone3SunsetWest74.85102-01-20Tynia Malone27YanakiNorthWest641.45
1303-01-20Chantel Mims7YanakiMexico188.65104-01-20Chantel Mims48Crested BeautWest934.2102-01-20Hien Pham13SunsetMidWest337.35
1403-01-20Hien Pham5YanakiMexico139.75004-01-20Kiki Sho25QuadMexico907.16102-01-20Chantel Mims36SunsetMidWest732.87
1503-01-20Chantel Mims37QuadMexico1374.05004-01-20Chantel Mims275YanakiWest4419.59002-01-20Tynia Malone44QuadSouth1596.61
1603-01-20Janis Figueroa525QuadMexico13188.92005-01-20Chantel Mims200QuadEast5976.6003-01-20Hien Pham100Crested BeautMidWest1816.5
1703-01-20Chantel Mims450SunsetNorthWest6714.56105-01-20Chantel Mims28QuadMidWest1039.82103-01-20Chantel Mims37QuadMexico1374.05
1804-01-20Hien Pham45SunsetCanada916.091103-01-20Janis Figueroa525QuadMexico13188.92
1904-01-20Tynia Malone3SunsetWest74.850103-01-20Chantel Mims450SunsetNorthWest6714.56
2004-01-20Chantel Mims48Crested BeautWest934.20004-01-20Tynia Malone3SunsetWest74.85
2104-01-20Chantel Mims100Crested BeautMidWest1746.51104-01-20Chantel Mims48Crested BeautWest934.2
2204-01-20Hien Pham2YanakiSouth55.91104-01-20Chantel Mims100Crested BeautMidWest1746.5
2304-01-20Kiki Sho25QuadMexico907.160104-01-20Kiki Sho25QuadMexico907.16
2404-01-20Chantel Mims8Crested BeautSouth215.60004-01-20Kiki Sho34Crested BeautMidWest778.86
2504-01-20Kiki Sho34Crested BeautMidWest778.861104-01-20Chantel Mims275YanakiWest4419.59
2604-01-20Chantel Mims275YanakiWest4419.590005-01-20Chantel Mims200QuadEast5976.6
2705-01-20Chantel Mims200QuadEast5976.60105-01-20Janis Figueroa36Majestic BeautMidWest1069.47
2805-01-20Hien Pham600YanakiEast9297.751105-01-20Chantel Mims28QuadMidWest1039.82
2905-01-20Janis Figueroa36Majestic BeautMidWest1069.471105-01-20Kiki Sho525YanakiMidWest8437.41
3005-01-20Chantel Mims28QuadMidWest1039.8200
3105-01-20Kiki Sho525YanakiMidWest8437.4101
3205-01-20Chantel Mims6Majestic BeautCanada209.712
3301
3400
35
T_AFA post
Cell Formulas
RangeFormula
H2,S4,J4,Q2H2=FORMULATEXT(H3)
H3:H34H3=T_AFA(A1:F32,{5,4},{"west","quad"},)
Q3:Q34Q3=T_AFA(A1:F32,{4,5},{"quad","*west"},0)
J5:O17J5=FILTER(A1:F32,H3#)
S5:X29S5=FILTER(A1:F32,Q3#)
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,215,521
Messages
6,125,303
Members
449,218
Latest member
Excel Master

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