Data roughly in the format
A B C
ID1 ID2 0.5
ID1 ID3 0.7
ID2 ID3 0.9
I want to create a correlation matrix (column C being the correlation between the IDs in A and B). It can definitely be done with a pivot table, though I have to use sum which could be risky if a duplicate existed since an error might not be apparent. Output format would be:
ID1 ID2 ID3
ID1 1 .5 .7
ID2 .5 1 .9
ID3 .7 .9 1
(the '1' is easily done with an =IF(B$2=$A3,1,0)
and replacing 0 with the formula to find the correlation)
I basically want a match (col a= ID1
&& col b = ID2
). I suspect it could be done by concatenation, but I am not sure that is a great solution? Match/Vlookup etc only return the first match [in that column], which is no good to me. Ode to a 'where' clause I guess?
My searches did not reveal any usuable help, I have already calculated the correlation and am putting it into excel from SQL. So yeah, any ideas would be super, a pivot table being a last resort.
Thanks.
Why don't you create a third column that combines the values from columns
A
andB
using=A1&B1
and then dovlookup
on that value:Assuming your source data range is on Sheet1, from A1 to C3 and your results range is on Sheet2, from A1 to D4.
You can put this formula on B2:
and then, drag and drop this formula on the whole range.