Lookup value in a Matrix based on 1 reference value

Dustinkli

Board Regular
Joined
Mar 26, 2019
Messages
62
Office Version
  1. 365
  2. 2011
Platform
  1. Windows
Hello,

I have a matrix as shown below:

Asset AAsset BAsset CAsset D
Asset A100%75%55%32%
Asset B75%100%25%87%
Asset C55%25%100%87%
Asset D32%87%90%100%

I would like to create a formula that shows the most correlated assets in the matrix. I'm not sure how to do this. I figured that perhaps using the "LARGE" function and excluding the two assets that are the same (Thus 100%) and making a column of the top x # of correlation #s and then trying to do an index or match with Vlookup based on that but everything I try fails. I know how to do a lookup if it were just 2 columns but in a matrix it is throwing me off. Maybe I'm missing something.
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
It would be great if you put the result you want.
I will venture to see if this is what you need:

Dante Amor
ABCDEFGHI
1Asset AAsset BAsset CAsset DAsset 1Asset 2%
2Asset A100%75%55%32%Asset DAsset C90%
3Asset B75%100%25%87%Asset DAsset B87%
4Asset C55%25%100%87%Asset CAsset D87%
5Asset D32%87%90%100%Asset BAsset D87%
6Asset BAsset A75%
7Asset AAsset B75%
Hoja10
Cell Formulas
RangeFormula
G2:G7G2=INDEX($A$2:$A$5,LARGE(IF(I2=$B$2:$E$5,ROW($A$2:$A$5)),COUNTIF($I$1:I2,I2))-ROW($A$2)+1)
H2:H7H2=INDEX($B$1:$E$1,,SMALL(IF(I2=$B$2:$E$5,COLUMN($B$1:$E$1)),COUNTIF($I$1:I2,I2))-COLUMN($B$1)+1)
I2:I7I2=LARGE(IF($B$2:$E$5<1,$B$2:$E$5),ROWS(J$2:J2))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
That looks like it might work, but when I paste it into my excel I get #VALUE! errors for everything.
 
Upvote 0
If you have Excel 365 with the new SEQUENCE function, then this should work::

Book1
ABCDEFGHI
1Asset AAsset BAsset CAsset DAsset 1Asset 2%
2Asset A100%75%55%32%Asset DAsset C90%
3Asset B75%100%25%87%Asset DAsset B87%
4Asset C55%25%100%90%Asset BAsset A75%
5Asset D32%87%90%100%Asset CAsset A55%
6Asset DAsset A32%
7Asset CAsset B25%
8
Sheet8
Cell Formulas
RangeFormula
G2:I7G2=SORT(FILTER(CHOOSE({1,2,3},INDEX(A2:A5,SEQUENCE(COUNTA(B2:E5),,,1/COLUMNS(B2:E5))),INDEX(B1:E1,MOD(SEQUENCE(COUNTA(B2:E5),,0),COLUMNS(B2:E5))+1),INDEX(B2:E5,SEQUENCE(COUNTA(B2:E5),,,1/COLUMNS(B2:E5)),MOD(SEQUENCE(COUNTA(B2:E5),,0),COLUMNS(B2:E5))+1)),INT(SEQUENCE(COUNTA(B2:E5),,,1/COLUMNS(B2:E5)))>MOD(SEQUENCE(COUNTA(B2:E5),,0),COLUMNS(B2:E5))+1),3,-1)
Dynamic array formulas.


If you have the new LET function as well, that formula can be shortened quite a bit.
 
Upvote 0
That looks like it might work, but when I paste it into my excel I get #VALUE! errors for everything.
All formulas are array formulas, to accept you must press Control + Shift + Enter, not just Enter.
 
Upvote 0

Forum statistics

Threads
1,214,915
Messages
6,122,212
Members
449,074
Latest member
cancansova

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