通过id键查找2个表中不同值的列表

问题描述 投票:0回答:1

我有 2 个表,它们的 ID 相同,但某些单元格的值不同。我想在新选项卡上找到以下格式的不同值: ID,sheet1_field,sheet2_field,sheet1_data,sheet2_data。

最好的方法是什么?

请在以下电子表格中找到示例和预期结果 - https://docs.google.com/spreadsheets/d/1W9aLJZoypoFT7xyKdpk1rXhTL1BVruZpbpoPhzKswmU/edit?gid=1041107819#gid=1041107819

google-sheets spreadsheet
1个回答
0
投票

您可以尝试:

=let(Λ,tocol(,1), reduce(Λ,Sheet1!B2:index(Sheet1!E:E,match(,0/(Sheet1!A:A<>""))),lambda(a,x,vstack(if(iserr(+a),Λ,a),let(r,row(x),c,column(x),z,index(Sheet1!A:A,r),
    Σ,vlookup(z,choosecols(Sheet2!A:E,1,c),2,),if(x=Σ,Λ,hstack(z,index(Sheet1!1:1,c),index(Sheet2!1:1,c),x,Σ)))))))

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.