问题描述
我有下面的第一张表
我在下面有第二张纸
我希望结果是
解决方法
假设 Excel Tables
的位置如下:
表格 | 工作表 | 地址 |
---|---|---|
Table1 | Sht(1) | B2:C4 |
Table2 | Sht(2) | B2:F12 |
结果 | Sht(0) | B2:G12 |
在表 Results
中输入这些公式:
字段:Name
= IFERROR( INDEX( Table2[Name],AGGREGATE( 15,6,ROW(D:D) /
( ( MATCH( Table2[Id],Table1[Id],0 ) > 0 ) * 1 ),ROWS(D$3:D3) ) ),TEXT(,) )
字段:Id
= IFERROR( INDEX( Table2[Id],MATCH( [@Name],Table2[Name],0 ) ),) )
字段:Program
= IFERROR( INDEX( Table1[Program],MATCH( [@Id],) )
字段:Maths
=IFERROR( INDEX( Table2[Maths],) )
字段:Science
=IFERROR( INDEX( Table2[Science],) )
字段:English
=IFERROR( INDEX( Table2[English],) )
如果您不使用 Excel Tables
,请使用以下公式:
字段:Name
= IFERROR( INDEX( 'Sht(2)'!$C$3:$C$12,ROW(D:D) /
( ( MATCH( 'Sht(2)'!$B$3:$B$12,'Sht(1)'!$C$3:$C$4,) )
字段 Id
= IFERROR( INDEX( 'Sht(2)'!$B$3:$B$12,MATCH( 'Sht(3)'!$D3,'Sht(2)'!$C$3:$C$12,) )
字段 Program
= IFERROR( INDEX( 'Sht(1)'!$B$3:$B$4,MATCH( 'Sht(3)'!$C3,) )
字段 Maths
=IFERROR( INDEX( 'Sht(2)'!$D$3:$D$12,) )
字段 Science
=IFERROR( INDEX( 'Sht(2)'!$E$3:$E$12,) )
字段 English
=IFERROR( INDEX( 'Sht(2)'!$F$3:$F$12,) )
关于所使用的函数的说明可以在here中找到,在这个页面中:
AGGREGATE function
INDEX function
MATCH function