# Co-variance of Portfolio A with Portfolio B

I'm trying to calculate the correlation between two separate portfolios.

I've used A*COV(AB)*B to calculate the co-variance of each portfolio where:

A = Array of weights of stocks within portfolio 1

B = Array of weights of stocks within portfolio 2

COV(AB) = Co-variance/variance matrix of stocks within either portfolio

The result that comes out is an array with 1 row and 5 columns with the same figure in each column (picture below).

I'm wondering, is the co-variance of the portfolio the sum of the 1*4 array that I got for the answer, or just one cell in the array?

• If you take $A^T* COV* B$ then the result will be 1 x1 ( a scalar). (1xN * NxN * Nx1 = 1x1). I believe you forgot to take the transpose of A. The vector on the left needs to be a row vector. – Alex C Feb 2 '19 at 16:29
If you take $$A^T∗COV∗B$$ then the result will be 1 x1 ( a scalar). (1xN * NxN * Nx1 = 1x1).