For CAPM Beta
Taken individual beta for each stock and multiplied it with the weight of each stock in the portfolio. Sum up the product of each stock beta and its weight to get CAPM BETA
Calculate the variance and covariance matrix using covariance in the data analytics option. Perform Mmult function for the transpose of the weight matrix, covariance matrix and then gain with weight matrix without transpose. You will get the total risk of the portfolio.
Calculate the portfolio expected return then divide it by market return
Sum of the variance of all the stocks divided by the number of stock
Calculate the correlation of each stock with the market and multiply it with the weight. Do summation of the square of the product.