I am trying to calculate several correlation matrices using the matrix language in excel. I have no problem with a straightforward problem but when I want to compute three matrices based on three unique values of a variable I am not able to get the if stmt to work properly . Specifically I have three scenarios (risk loving, normal, risk averse) coded in say column b2:b253. My return data is in columns c2:c253. My goal is to create three correlation matrices depending on the value in column b. my code is =MMULT(IF(B2:B253="RISK LOVING",TRANSPOSE($C$2:$L$253-$O$3:$X$3),$C$2:$L$253-$O$3:$X$3)/$P$1/MMULT(TRANSPOSE($O$4:$X$4),$O$4:$X$4),0). Any suggestions?
Aucun commentaire:
Enregistrer un commentaire