How to do correlation using dynamic criteria in excel

105 Views Asked by At

First time with VBA excel. Always used formulas, however not able to do the below mentioned problem. I would really appreciate any help.

I would like to correlation. My data is in one sheet1 with unique ID and on the other sheet, I have a Client ID. I would like to match the Client ID on sheet1 with that on Sheet2, select all the values in two columns(Actual Consumption and forecast consumption) corresponding to those ID and return the correlation between the two and then move to the next ID on sheet 2 and repeat the process.

I have never written any macro in excel. Always got my way with formulas, however not able to do this one.

Thanks in advance, My data looks like this and on the second sheet I have the client ID

enter image description here

Screen shot of sheet2

enter image description here

0

There are 0 best solutions below