INDEX & MATCH for multiple contiguous columns & row (i.e. a range) ?

jxb

Board Regular
Joined
Apr 19, 2007
Messages
172
Office Version
  1. 2010
Platform
  1. Windows
INDEX & MATCH for multiple contiguous columns & row (i.e. a range) ?

I cannot remember the exact syntax to find a value in a range of multiple columns and rows (a “table” and returns a value in a specific column (in the same row). I used in the past but forgotten !

In the example below

Max value in range B2:D4

Returns the value in the same row in column A

Is it also possible to return the column the max value is ?


Thanks

John

1659792615583.png
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
One approach...
MrExcel_20220805.xlsx
ABCDEFG
1IDv1v2v3Max at:
26110023row index3
38141116column index1
47110119ID at Max val71
Sheet4
Cell Formulas
RangeFormula
G2G2=MAX(IF($B$2:$D$4=MAX($B$2:$D$4),ROW($2:$4)-ROW($2:$2)+1))
G3G3=MAX(IF($B$2:$D$4=MAX($B$2:$D$4),COLUMN($B:$D)-COLUMN($B:$B)+1))
G4G4=INDEX($A$2:$A$4,G2)
 
Upvote 0
How about
Fluff.xlsm
ABCD
1ABC
26110023
3816116
47110119
5
6
7Row71
8ColA
Main
Cell Formulas
RangeFormula
B7B7=INDEX(A2:A4,AGGREGATE(15,6,(ROW(A2:A4)-ROW(A2)+1)/(B2:D4=MAX(B2:D4)),1))
B8B8=INDEX(B1:D1,MATCH(MAX(B2:D4),INDEX(B2:D4,MATCH(B7,A2:A4,0),),0))
 
Upvote 0
Solution
You can try this for example:

=INDEX(A2:A4,AGGREGATE(14,6,MMULT(IFERROR(SEARCH(MAX(B2:D4),B2:D4)^0,0),SEQUENCE(3)^0)*SEQUENCE(3),1),1)
 
Upvote 0
One approach...
MrExcel_20220805.xlsx
ABCDEFG
1IDv1v2v3Max at:
26110023row index3
38141116column index1
47110119ID at Max val71
Sheet4
Cell Formulas
RangeFormula
G2G2=MAX(IF($B$2:$D$4=MAX($B$2:$D$4),ROW($2:$4)-ROW($2:$2)+1))
G3G3=MAX(IF($B$2:$D$4=MAX($B$2:$D$4),COLUMN($B:$D)-COLUMN($B:$B)+1))
G4G4=INDEX($A$2:$A$4,G2)
in reply to KRice suggestion: with Ctrl+ Shift + Enter I take it !
 
Upvote 0
You can try this for example:

=INDEX(A2:A4,AGGREGATE(14,6,MMULT(IFERROR(SEARCH(MAX(B2:D4),B2:D4)^0,0),SEQUENCE(3)^0)*SEQUENCE(3),1),1)
I am so sorry i didn't notice your excel version. You might ignore
 
Upvote 0
The formula in G2 & G3 will need Ctrl Shift Enter, although the formulae I suggested don't need it.
 
Upvote 0
The formula in G2 & G3 will need Ctrl Shift Enter, although the formulae I suggested don't need it.
Thanks a lot. These are the ones I am looking at right now. As "straight" formulas
 
Upvote 0
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,926
Messages
6,122,306
Members
449,079
Latest member
juggernaut24

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