S
Scott Dobbs
I have generated a database of company returns which is
put into arrays by company (companies are assigned a
number each) and the returns are labelled in the worksheet
as "dataset1", "dataset2" etc. I am now trying to generate
a covariance matrix where all I need to do is substitute
the numbers for the company on an array across the top and
side of the matrix, and I want excel to refer to the
dataset which coincides with the number. In short, I
substitute numbers across the top and down the left side
such as 1,4,5,7,9,13, etc. (ten wide and ten deep) and I
want to write the function something like:
=covar(dataset(R[-2]),dataset(C[-4]))for each cell which
should contain the covariance in a markowitz covariance
matrix and have the references go to the respective
datasets to input the arrays. I am wondering if I should
write another sub which tries to recognise that the inputs
(as integers) should be set against the datasets. Should I
use ranges as pure cell references? I haven't worked with
excel extensively since about 1996 and I am forgetting
most of what I know.
Any help?
thanks
Scott
put into arrays by company (companies are assigned a
number each) and the returns are labelled in the worksheet
as "dataset1", "dataset2" etc. I am now trying to generate
a covariance matrix where all I need to do is substitute
the numbers for the company on an array across the top and
side of the matrix, and I want excel to refer to the
dataset which coincides with the number. In short, I
substitute numbers across the top and down the left side
such as 1,4,5,7,9,13, etc. (ten wide and ten deep) and I
want to write the function something like:
=covar(dataset(R[-2]),dataset(C[-4]))for each cell which
should contain the covariance in a markowitz covariance
matrix and have the references go to the respective
datasets to input the arrays. I am wondering if I should
write another sub which tries to recognise that the inputs
(as integers) should be set against the datasets. Should I
use ranges as pure cell references? I haven't worked with
excel extensively since about 1996 and I am forgetting
most of what I know.
Any help?
thanks
Scott