Finding column and row number for the nth largest value in an array

brocoe

New Member
Joined
Oct 2, 2014
Messages
5
Hello,

I am having a problem getting the row and column for a specific value in an array. I have about 200 data sets that each contain 400 observations. I need to correlate all of these data sets with each other and find the 100 most highly correlated pairs. Finding the 100 highest is simply a matter of using the large function but finding the pairs that give me that correlation is where I am running into some problems. Below is a simplified example of what I need to happen.

My array looks similar to this:
ABCDE
E.85.42.56.24
D.32.91.44
C.76-.15
B-.20
A

<tbody>
</tbody>

The results page should look something like this.

CorrelationRowColumn
1st largest.91DB
2nd largest.85EA
3rd largest.76CA

<tbody>
</tbody>






Given the large amount of data number of data points per data set (~400) all the correlations in the table will be unique. I am looking for a solution that DOESN'T require VBA but I would be amenable to using a custom function from VBA. So if anyone can provide me with a solution to getting the bolded results as show above it would be greatly appreciated.
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
Given your data setup as below:


Formula in B9 copy down:
Code:
=LARGE($B$2:$F$6,A9)

Formula in C9 copy down:
Code:
=INDEX($A$2:$A$6,SUMPRODUCT(--($B$2:$F$6=B9)*ROW($A$2:$A$6))-1)

Formula in D9 copy down:
Code:
=INDEX($B$1:$F$1,SUMPRODUCT(--($B$2:$F$6=B9)*COLUMN($B$1:$F$1))-1)

A
B
C
D
E
F
1
A
B
C
D
E
2
E
0.85
0.42
0.56
0.24
3
D
0.32
0.91
0.44
4
C
0.76
-0.15
5
B
-0.2
6
A
7
8
Rank
Correlation
Row
Column
9
1
0.91
D
B
10
2
0.85
E
A
11
3
0.76
C
A

<TBODY>
</TBODY>
 
Upvote 0
I've been trying to find a solution to this for two days. It's amazing that you solved it in 15 minutes.
 
Upvote 0

Forum statistics

Threads
1,215,332
Messages
6,124,313
Members
449,153
Latest member
JazzSingerNL

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