Calculate the Correlation of two arrays where each array is disjointed

时间:2019-03-06 11:42:17

标签: excel

I have data similar to the following in Excel:

             A           B
 1           1,287.90    221,300 
 2           0           0
 3           1,828.93    64,080 
 4           417.81      0
 5           397.37      76,529 
 6           1,371.69    0
 7           1,316.81    50,761 
 8           1,828.93    28,645 

I want to calculate the correlation coefficient of these two arrays where there are non-zeros. I want to do this without copying the data to a separate sheet with the zeros removed. I have tried this for example:

CORREL({A1,A3,A5, A7:A8}, {B1,B3,B5, B7:B8}) but this does not work. Any ideas

1 个答案:

答案 0 :(得分:3)

如果我错了,请纠正我,但我认为您不必执行任何操作:

correlation

如您所见,相关结果是相同的。我是否误解了您的问题?

更新:从您的评论中,我想问题上的虚线单元格可能代表零,并且您想从结果中删除这些值。如果是这种情况,您可以放置​​公式:

Ctrl + Shift + Enter

别忘了用std::string输入公式来放置方括号。