Conditional correlation of returns

pathway1

New Member
Joined
Jan 10, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hello forum,
Thank you in advance for your help.
I need to create a correlation matrix (simple, edited pic attached) that returns the correlation coefficient of columns 1 and 2 for the subset of periods where a third column, Equity, is down at least -2%.
Within a conditional correlation, I nested a condition of what I thought was "if downside deviation exceeds -2%", which I expected to ignore any period when US equity was >-2%, thus return correlation of columns 1 and 2 for the subset of periods that I was looking for. Instead, it is just returning the correlation of columns 1 and 2. What have I missed here, and how do I fix it (Excel only)?

My incorrect attempt (cell A3):
=CORREL(IF(STDEV(IF($L$15:$L$29<-2%,$L$15:$L$29,"")), $A$15:$A$29),$B$15:$B$29)
 

Attachments

  • Correlation Question - Monthly Returns.JPG
    Correlation Question - Monthly Returns.JPG
    53.9 KB · Views: 22

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Using function FILTER is the easiest way to extract values from lists. Like this:

MrExcel posts19.xlsx
BCDEFGHIJ
3hurdle-2.0%correlation:-0.07772correlation (single cell):-0.07772
4
512ehelper 1helper 2
69.9%6.6%2.1%-3.1%7.8%
71.1%8.7%2.0%7.0%-4.9%
8-3.1%7.8%-3.0%-0.6%-7.3%
9-9.8%9.3%-1.0%1.6%8.6%
105.5%-9.2%5.0%5.0%7.6%
117.0%-4.9%-8.0%5.2%-2.2%
12-7.5%-1.9%-1.0%-1.7%-7.2%
13-1.5%5.9%-1.0%-5.9%6.5%
14-4.5%1.3%6.0%-9.5%-1.6%
151.2%5.1%6.0%
16-0.6%-7.3%-3.0%
17-7.9%-9.0%3.0%
181.6%8.6%-5.0%
195.0%7.6%-8.0%
205.2%-2.2%-9.0%
21-1.7%-7.2%-5.0%
22-3.7%7.4%5.0%
23-5.9%6.5%-10.0%
24-9.5%-1.6%-3.0%
Sheet37
Cell Formulas
RangeFormula
G3G3=CORREL(F6#,G6#)
J3J3=CORREL(FILTER(B6:B24,D6:D24<=D3),FILTER(C6:C24,D6:D24<=D3))
F6:F14F6=FILTER(B6:B24,D6:D24<=D3)
G6:G14G6=FILTER(C6:C24,D6:D24<=D3)
Dynamic array formulas.
Cells with Conditional Formatting
CellConditionCell FormatStop If True
D6:D24Cell Value<=$D$3textNO
 
Upvote 0
Solution

Forum statistics

Threads
1,224,823
Messages
6,181,184
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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