I have 30 securities with 5 years on monthly returns
Securities across row A and returns down the columns
A B C D
1 IBM TGT HD
2 1 3 2
3 -.5 2 -1
4 2 6 -3I want to create a matrix that correlates the return of every security
against every securit
IBM TGT HD
IBM
TGT
HD
Is there a way to put a look up function into a correlation furnction when
you want it to supply you with an array?
=Correl(lookup (IBM,other work sheet row A, give array set below IBM in
other work sheet), lookup TGT, other work sheet row a, give array set below
TGT in other worksheet)
This type of formula is not working for me so any suggestions would be great.
Assumptions:
Source table...
A1:C1 contains IBM, TGT, and HD
A2:C4 contains your data
Results table...
F1:H1 contains IBM, TGT, and HD
E2:E4 contains IBM, TGT, and HD
Formula:
F2, copied down and across:
=CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A$1:$C$1,0)), INDEX($A$2:$C$4,0,MATCH
(F$1,$A$1:$C$1,0)))
If you want the formula to leave the cell empty when correlating the
same security, try the following formula instead...
=IF($E2lt;gt;F$1,CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A $1:$C$1,0)),INDEX($A$2:
$C$4,0,MATCH(F$1,$A$1:$C$1,0))),quot;quot;)
Adjust the ranges accordingly.
Hope this helps!
In article gt;,
quot;katiequot; gt; wrote:
gt; I have 30 securities with 5 years on monthly returns
gt; Securities across row A and returns down the columns
gt;
gt; A B C D
gt; 1 IBM TGT HD
gt; 2 1 3 2
gt; 3 -.5 2 -1
gt; 4 2 6 -3
gt;
gt;
gt; I want to create a matrix that correlates the return of every security
gt; against every securit
gt;
gt; IBM TGT HD
gt; IBM
gt; TGT
gt; HD
gt;
gt; Is there a way to put a look up function into a correlation furnction when
gt; you want it to supply you with an array?
gt;
gt; =Correl(lookup (IBM,other work sheet row A, give array set below IBM in
gt; other work sheet), lookup TGT, other work sheet row a, give array set below
gt; TGT in other worksheet)
gt;
gt; This type of formula is not working for me so any suggestions would be great.
You can use the OFFSET function to dynamically create the array references.
Something like:
=IF(B$1=$A2,quot;quot;,CORREL(OFFSET(Sheet1!$A$2,0,MATCH($ A2,Sheet1!$1:$1,FALSE)-1,5,1),OFFSET(Sheet1!$A$2,0,MATCH(B$1,Sheet1!$1:$1 ,FALSE)-1,5,1)))
The first part of the IF just says not to bother correlating a security
against itself.
The MATCH functions figure out which columns of data to pull from sheet1.
The OFFSET functions use the match results to create the two arrays; the 5
in each OFFSET is to get five rows -- years -- of data.
--Brucequot;katiequot; wrote:
gt; I have 30 securities with 5 years on monthly returns
gt; Securities across row A and returns down the columns
gt;
gt; A B C D
gt; 1 IBM TGT HD
gt; 2 1 3 2
gt; 3 -.5 2 -1
gt; 4 2 6 -3
gt;
gt;
gt; I want to create a matrix that correlates the return of every security
gt; against every securit
gt;
gt; IBM TGT HD
gt; IBM
gt; TGT
gt; HD
gt;
gt; Is there a way to put a look up function into a correlation furnction when
gt; you want it to supply you with an array?
gt;
gt; =Correl(lookup (IBM,other work sheet row A, give array set below IBM in
gt; other work sheet), lookup TGT, other work sheet row a, give array set below
gt; TGT in other worksheet)
gt;
gt; This type of formula is not working for me so any suggestions would be great.
you rock!!! thanks that worked
quot;Domenicquot; wrote:
gt; Assumptions:
gt;
gt; Source table...
gt;
gt; A1:C1 contains IBM, TGT, and HD
gt;
gt; A2:C4 contains your data
gt;
gt; Results table...
gt;
gt; F1:H1 contains IBM, TGT, and HD
gt;
gt; E2:E4 contains IBM, TGT, and HD
gt;
gt; Formula:
gt;
gt; F2, copied down and across:
gt;
gt; =CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A$1:$C$1,0)), INDEX($A$2:$C$4,0,MATCH
gt; (F$1,$A$1:$C$1,0)))
gt;
gt; If you want the formula to leave the cell empty when correlating the
gt; same security, try the following formula instead...
gt;
gt; =IF($E2lt;gt;F$1,CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A $1:$C$1,0)),INDEX($A$2:
gt; $C$4,0,MATCH(F$1,$A$1:$C$1,0))),quot;quot;)
gt;
gt; Adjust the ranges accordingly.
gt;
gt; Hope this helps!
gt;
gt; In article gt;,
gt; quot;katiequot; gt; wrote:
gt;
gt; gt; I have 30 securities with 5 years on monthly returns
gt; gt; Securities across row A and returns down the columns
gt; gt;
gt; gt; A B C D
gt; gt; 1 IBM TGT HD
gt; gt; 2 1 3 2
gt; gt; 3 -.5 2 -1
gt; gt; 4 2 6 -3
gt; gt;
gt; gt;
gt; gt; I want to create a matrix that correlates the return of every security
gt; gt; against every securit
gt; gt;
gt; gt; IBM TGT HD
gt; gt; IBM
gt; gt; TGT
gt; gt; HD
gt; gt;
gt; gt; Is there a way to put a look up function into a correlation furnction when
gt; gt; you want it to supply you with an array?
gt; gt;
gt; gt; =Correl(lookup (IBM,other work sheet row A, give array set below IBM in
gt; gt; other work sheet), lookup TGT, other work sheet row a, give array set below
gt; gt; TGT in other worksheet)
gt; gt;
gt; gt; This type of formula is not working for me so any suggestions would be great.
gt;
An alternative is to use the Correlation option from the Analysis Toolpak.
It will return the correlation matrix, as values, not formulas.
Pieter Vandenberg
Domenic gt; wrote:
: Assumptions:
: Source table...
: A1:C1 contains IBM, TGT, and HD
: A2:C4 contains your data
: Results table...
: F1:H1 contains IBM, TGT, and HD
: E2:E4 contains IBM, TGT, and HD
: Formula:
: F2, copied down and across:
: =CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A$1:$C$1,0)), INDEX($A$2:$C$4,0,MATCH
: (F$1,$A$1:$C$1,0)))
: If you want the formula to leave the cell empty when correlating the
: same security, try the following formula instead...
: =IF($E2lt;gt;F$1,CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A $1:$C$1,0)),INDEX($A$2:
: $C$4,0,MATCH(F$1,$A$1:$C$1,0))),quot;quot;)
: Adjust the ranges accordingly.
: Hope this helps!
: In article gt;,
: quot;katiequot; gt; wrote:
:gt; I have 30 securities with 5 years on monthly returns
:gt; Securities across row A and returns down the columns
:gt;
:gt; A B C D
:gt; 1 IBM TGT HD
:gt; 2 1 3 2
:gt; 3 -.5 2 -1
:gt; 4 2 6 -3
:gt;
:gt;
:gt; I want to create a matrix that correlates the return of every security
:gt; against every securit
:gt;
:gt; IBM TGT HD
:gt; IBM
:gt; TGT
:gt; HD
:gt;
:gt; Is there a way to put a look up function into a correlation furnction when
:gt; you want it to supply you with an array?
:gt;
:gt; =Correl(lookup (IBM,other work sheet row A, give array set below IBM in
:gt; other work sheet), lookup TGT, other work sheet row a, give array set below
:gt; TGT in other worksheet)
:gt;
:gt; This type of formula is not working for me so any suggestions would be great.
What if you have a results table which has labels that are the same? The
Match function simply finds the first instead of moving down to the proper
label. For example, my data essentially looks like this:
A B C...
1st# 2nd# 3rd# 4th# 5th# Sum Avg Med 1st# 2nd# 3rd# 4th#If only there was some way to have =Correl($A$2:$A$94,A$2:A$94) increase the
column value as you drag the auto fill handle down...
I need the matrix to be dynamic, which is why the analysis toolkit matrix
won't work for me.
Thanks in advance (as always)!quot;Domenicquot; wrote:
gt; Assumptions:
gt;
gt; Source table...
gt;
gt; A1:C1 contains IBM, TGT, and HD
gt;
gt; A2:C4 contains your data
gt;
gt; Results table...
gt;
gt; F1:H1 contains IBM, TGT, and HD
gt;
gt; E2:E4 contains IBM, TGT, and HD
gt;
gt; Formula:
gt;
gt; F2, copied down and across:
gt;
gt; =CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A$1:$C$1,0)), INDEX($A$2:$C$4,0,MATCH
gt; (F$1,$A$1:$C$1,0)))
gt;
gt; If you want the formula to leave the cell empty when correlating the
gt; same security, try the following formula instead...
gt;
gt; =IF($E2lt;gt;F$1,CORREL(INDEX($A$2:$C$4,0,MATCH($E2,$A $1:$C$1,0)),INDEX($A$2:
gt; $C$4,0,MATCH(F$1,$A$1:$C$1,0))),quot;quot;)
gt;
gt; Adjust the ranges accordingly.
gt;
gt; Hope this helps!
gt;
gt; In article gt;,
gt; quot;katiequot; gt; wrote:
gt;
gt; gt; I have 30 securities with 5 years on monthly returns
gt; gt; Securities across row A and returns down the columns
gt; gt;
gt; gt; A B C D
gt; gt; 1 IBM TGT HD
gt; gt; 2 1 3 2
gt; gt; 3 -.5 2 -1
gt; gt; 4 2 6 -3
gt; gt;
gt; gt;
gt; gt; I want to create a matrix that correlates the return of every security
gt; gt; against every securit
gt; gt;
gt; gt; IBM TGT HD
gt; gt; IBM
gt; gt; TGT
gt; gt; HD
gt; gt;
gt; gt; Is there a way to put a look up function into a correlation furnction when
gt; gt; you want it to supply you with an array?
gt; gt;
gt; gt; =Correl(lookup (IBM,other work sheet row A, give array set below IBM in
gt; gt; other work sheet), lookup TGT, other work sheet row a, give array set below
gt; gt; TGT in other worksheet)
gt; gt;
gt; gt; This type of formula is not working for me so any suggestions would be great.
gt;
- Jun 22 Fri 2007 20:37
Correlation Matrix
close
全站熱搜
留言列表
發表留言