INDEX MATCH MAXIFS / AGGREGATE - Multiple criteria

lagardem

New Member
Joined
May 31, 2017
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi there !

Hope you're all doing good !

Objective: I would like to retrieve the name of the state (row D16:AC16), that has the maximum/highest value (found in C20:AC120), for a some criteria (A6 to A10 per ex), selected within column A (A19:A124).

The search thus goes horizontally/vertically/left/right

Any idea of how it could be solved ?

Thanks a lot in advance !

Cheers

NB: I tried these, but I failed somehow :P :
=XLOOKUP(($A$20:$A$124=A6)*(MAX(IF($A$20:$A$124=A6;$C$20:$AC$124));$C$16:$AC$16))
=INDEX($C$16:$AC$16;MATCH(MAXIFS($C$19:$AC$124;$A$19:$A$124;A6);$C$19:$AC$124;0))
=INDEX($C$16:$AC$16;MATCH(MAX(IF($A$19:$A$124=A6;$C$19:$AC$124));$C$19:$AC$124;0))
=INDEX($C$16:$AC$16;MATCH(MAX(IF($A$19:$A$124=A7;$C$19:$AC$124));$C$19:$AC$124;0))
=INDEX($16:$16;AGGREGATE(15;6;COLUMN($C$16:$AC$16)/(INDEX($C$20:$AC$124;MATCH(LOOKUP(0;0/FREQUENCY(0;ABS($A$20:$A$124-A6));$A$20:$A$124);$A$20:$A$124;0)=INDEX($AD$20:$AD$124;MATCH(A6;$A$20:$A$124;0));1))))
=INDEX($14:$14;AGGREGATE(15;6;COLUMN($C$14:$AC$14)/(INDEX($C$20:$AC$124;MATCH(LOOKUP(0;0/FREQUENCY(0;ABS($A$20:$A$124-A6));$A$20:$A$124);$A$20:$A$124;0)=E6;1))))

INDEX MATCH MAXIFS_Multiple criteria.xlsx
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAG
1
2How could I retrieve the state with the highest values of the below criteria (D6 to D10), all at once, without adding columns AD and following ?
3
4
5Highest value INDEX MATCH State INDEX MATCH All at once formula ? :)
6Surfaces agricoles en %56FR
7Surfaces boisées en %51TI
8par km²5 300BS
9selon le Code pénal (CP)109BS
10selon la Loi sur les stupéfiants et les produits psychotropes (LStup)18BS
11
12
13
14RAW DATAADDED COLUMNS
15
16Choix d'indicateurs en comparaison régionale, 2021Année Suisse ZHBELUURSZOWNWGLZGFRSOBSBLSHARAISGGRAGTGTIVDVSNEGEJUMAX Related stateMINRelated state
17
18
19Population
20Habitants en milliers20198 606.01 539.31 039.5413.136.7160.537.943.140.6127.6321.8275.2195.8289.582.355.416.1510.7199.0685.8279.5351.5805.1345.5176.5504.173.61 539 ZH 16AI
21Variation en %2010-20199.412.16.19.43.69.46.65.05.112.915.57.85.95.57.84.62.86.63.312.212.55.312.910.52.610.15.116 FR 3NE
22par km²2019215.2926.8178.0289.134.7188.578.9178.559.6616.2202.0348.25 300.2559.2276.2228.393.5261.828.0491.6323.9128.2285.466.3246.32 050.887.85 300 BS 28GR
23Répartition par âge en %2019- N/A, nfwd -N/A, nfwd
240–1920.019.819.020.320.019.320.018.119.220.322.219.017.319.218.720.221.120.517.820.220.318.021.919.621.021.020.822 FR 17BS
2520–6461.463.259.961.959.262.660.761.060.562.461.861.162.958.759.959.959.361.060.561.861.859.161.560.559.862.557.963 ZH 58JU
2665 ou plus18.717.021.117.820.818.219.320.920.417.316.019.919.822.221.419.919.618.521.717.917.923.016.619.919.316.421.323 TI 16FR
27Population urbaine en % 1)201984.899.374.763.988.682.127.650.576.7100.074.885.9100.097.689.776.60.082.444.985.067.092.889.678.987.8100.053.7100 ZG -AI
28Etrangers en %201925.327.116.618.812.621.914.714.824.228.322.822.936.623.126.116.511.324.418.825.325.227.633.022.625.340.014.740 GE 11AI
29Mouvement de la population (en ‰)2019- N/A, nfwd -N/A, nfwd
30Taux brut de nuptialité4.55.24.44.84.84.65.04.34.34.94.24.64.94.44.95.04.95.04.34.74.93.43.94.23.64.33.75 ZH 3TI
31Taux brut de divortialité2.02.01.91.61.31.91.42.11.41.92.01.82.01.82.02.01.01.91.72.01.92.12.12.12.22.32.32 JU 1AI
32Taux brut de natalité10.010.89.610.69.49.69.28.910.210.410.99.510.58.88.810.110.810.38.210.310.47.110.79.19.510.79.611 FR 7TI
33Taux brut de mortalité7.97.49.37.58.46.97.47.810.36.26.68.410.68.69.88.78.37.98.87.37.59.26.88.49.06.79.111 BS 6ZG
34Ménages privés en milliers20193 81169247517915691619185513412397129382472239229712216435415382203323 811 N/A, nfwd 7AI
35Taille moyenne des ménages en personnes20192.22.22.12.32.32.32.32.22.22.32.42.21.92.22.12.32.42.32.12.32.32.12.22.22.12.42.22 AI 2BS
36- N/A, nfwd -N/A, nfwd
37Langue principale en % 2) 3)2019- N/A, nfwd -N/A, nfwd
38Allemand62.780.783.788.693.488.392.090.686.580.326.187.176.886.286.890.894.987.775.286.489.110.25.524.64.74.07.495 AI 4GE
39Français22.83.311.01.6X1.9(1.5)(1.6)(1.2)3.469.02.95.03.2(1.8)(1.1)X1.31.32.01.34.782.667.887.779.689.890 JU 1AR
40Italien8.35.63.13.3(1.4)3.5(1.2)(3.2)5.54.32.44.86.15.53.9(2.3)(1.5)3.513.25.13.788.65.04.65.76.42.589 TI 1OW
41Romanche0.50.3(0.1)(0.2)X(0.3)(0.6)X(0.6)(0.2)(0.1)(0.2)(0.2)(0.1)XXX(0.4)14.7(0.1)(0.1)(0.1)(0.0)XX(0.1)X15 GR 0VD
42Anglais6.59.54.44.6(3.3)6.3(3.5)5.4(4.0)12.13.94.312.16.75.24.6(3.3)4.13.45.53.93.98.93.84.612.2(2.3)12 GE 2JU
43- N/A, nfwd -N/A, nfwd
44Appartenance à une religion en % 2)2019- N/A, nfwd -N/A, nfwd
45Catholiques romains34.424.915.458.874.856.568.162.730.148.058.031.214.926.221.127.774.042.040.230.230.062.827.768.919.731.064.375 UR 15BS
46Evangéliques réformés22.526.747.59.4(5.0)11.310.411.330.912.711.818.814.627.632.637.6(9.2)19.331.522.229.83.921.45.619.28.29.848 BE 4TI
47Sans appartenance religieuse29.532.724.020.914.721.815.820.224.826.620.835.952.832.528.721.7(10.9)22.021.331.725.424.236.417.848.844.317.353 BS 11AI
Data OFS
Cell Formulas
RangeFormula
B6:B10B6=INDEX($AD$20:$AD$124,MATCH(A6,$A$20:$A$124,0))
C6:C10C6=INDEX($AE$20:$AE$124,MATCH(A6,$A$20:$A$124,0))
AD20AD20=MAX(D20:AC20)
AE20:AE47AE20=IFERROR(INDEX($D$16:$AC$16,MATCH(AD20,D20:AC20,0)),"N/A, nfwd")
AF20:AF47AF20=MIN(C20:AC20)
AG20:AG47AG20=IFERROR(INDEX($D$16:$AC$16,MATCH(AF20,D20:AC20,0)),"N/A, nfwd")
AD21:AD47AD21=MAX(C21:AC21)
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
How about
Fluff.xlsm
ABCDEFGHIJKLMNOPQRSTUVWXYZAAABAC
1
2
3
4
5Highest value INDEX MATCH State INDEX MATCH All at once formula ? :)
6Surfaces agricoles en %100.0ZGZG
7Surfaces boisées en %47.5BEBE
8par km²5300.2BSBS
9selon le Code pénal (CP)40.0GEGE
10selon la Loi sur les stupéfiants et les produits psychotropes (LStup)0.0N/A, nfwdN/A, nfwd
11
12
13
14RAW DATA
15
16Choix d'indicateurs en comparaison régionale, 2021Année Suisse ZHBELUURSZOWNWGLZGFRSOBSBLSHARAISGGRAGTGTIVDVSNEGEJU
17
18
19Population
20Habitants en milliers20198606.01539.31039.5413.136.7160.537.943.140.6127.6321.8275.2195.8289.582.355.416.1510.7199.0685.8279.5351.5805.1345.5176.5504.173.6
21Variation en %2010-20199.412.16.19.43.69.46.65.05.112.915.57.85.95.57.84.62.86.63.312.212.55.312.910.52.610.15.1
22par km²2019215.2926.8178.0289.134.7188.578.9178.559.6616.2202.0348.25300.2559.2276.2228.393.5261.828.0491.6323.9128.2285.466.3246.32050.887.8
23Répartition par âge en %2019
240–1920.019.819.020.320.019.320.018.119.220.322.219.017.319.218.720.221.120.517.820.220.318.021.919.621.021.020.8
2520–6461.463.259.961.959.262.660.761.060.562.461.861.162.958.759.959.959.361.060.561.861.859.161.560.559.862.557.9
2665 ou plus18.717.021.117.820.818.219.320.920.417.316.019.919.822.221.419.919.618.521.717.917.923.016.619.919.316.421.3
27Surfaces agricoles en %201984.899.374.763.988.682.127.650.576.7100.074.885.9100.097.689.776.60.082.444.985.067.092.889.678.987.8100.053.7
28selon le Code pénal (CP)201925.327.116.618.812.621.914.714.824.228.322.822.936.623.126.116.511.324.418.825.325.227.633.022.625.340.014.7
29selon la Loi sur les stupéfiants et les produits psychotropes (LStup)2019
30Taux brut de nuptialité4.55.24.44.84.84.65.04.34.34.94.24.64.94.44.95.04.95.04.34.74.93.43.94.23.64.33.7
31Taux brut de divortialité2.02.01.91.61.31.91.42.11.41.92.01.82.01.82.02.01.01.91.72.01.92.12.12.12.22.32.3
32Taux brut de natalité10.010.89.610.69.49.69.28.910.210.410.99.510.58.88.810.110.810.38.210.310.47.110.79.19.510.79.6
33Taux brut de mortalité7.97.49.37.58.46.97.47.810.36.26.68.410.68.69.88.78.37.98.87.37.59.26.88.49.06.79.1
34Ménages privés en milliers20193811.3691.7474.6179.315.569.316.219.118.154.9133.5122.997.5128.737.724.06.5223.092.4297.3121.7163.7354.5152.681.5202.632.4
35Taille moyenne des ménages en personnes20192.22.22.12.32.32.32.32.22.22.32.42.21.92.22.12.32.42.32.12.32.32.12.22.22.12.42.2
36
37Langue principale en % 2) 3)2019
38Allemand62.780.783.788.693.488.392.090.686.580.326.187.176.886.286.890.894.987.775.286.489.110.25.524.64.74.07.4
39Français22.83.311.01.6X1.91.51.61.23.469.02.95.03.21.81.1X1.31.32.01.34.782.667.887.779.689.8
40Italien8.35.63.13.31.43.51.23.25.54.32.44.86.15.53.92.31.53.513.25.13.788.65.04.65.76.42.5
41Romanche0.50.30.10.2X0.30.6X0.60.20.10.20.20.1XXX0.414.70.10.10.10.0XX0.1X
42Anglais6.59.54.44.63.36.33.55.44.012.13.94.312.16.75.24.63.34.13.45.53.93.98.93.84.612.22.3
43
44Appartenance à une religion en % 2)2019
45Catholiques romains34.424.915.458.874.856.568.162.730.148.058.031.214.926.221.127.774.042.040.230.230.062.827.768.919.731.064.3
46Surfaces boisées en %22.526.747.59.45.011.310.411.330.912.711.818.814.627.632.637.69.219.331.522.229.83.921.45.619.28.29.8
47Sans appartenance religieuse29.532.724.020.914.721.815.820.224.826.620.835.952.832.528.721.710.922.021.331.725.424.236.417.848.844.317.3
Data
Cell Formulas
RangeFormula
B6:B10B6=INDEX($AD$20:$AD$124,MATCH(A6,$A$20:$A$124,0))
C6:C10C6=INDEX($AE$20:$AE$124,MATCH(A6,$A$20:$A$124,0))
D6:D10D6=LET(f,FILTER($D$20:$AC$120,$A$20:$A$120=A6),IF(MAX(f)=0,"N/A, nfwd",TAKE(SORTBY($D$16:$AC$16,f,-1),,1)))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,877
Messages
6,175,138
Members
452,614
Latest member
MRSWIN2709

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