Selecting a row in excel based on specific values in 2 columns,

后端 未结 2 1497
天涯浪人
天涯浪人 2020-12-21 22:25

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

相关标签:
2条回答
  • 2020-12-21 22:51

    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:

    =SUMPRODUCT((Sheet1!$A$1:$A$3=Sheet2!B$1)*(Sheet1!$B$1:$B$3=Sheet2!$A2)*Sheet1!$C$1:$C$3)
    

    and then, drag and drop this formula on the whole range.

    0 讨论(0)
  • 2020-12-21 23:00

    Why don't you create a third column that combines the values from columns A and B using =A1&B1 and then do vlookup on that value:

    A    B    C       D
    ID1  ID2  ID1ID2  0.5
    ID1  ID3  ID1ID3  0.7
    ID2  ID3  ID2ID3  0.9
    
    0 讨论(0)
提交回复
热议问题