4.6 按指定次序排序

 

将成绩表按学生的名单表次序排序,数据如下:
学生名单:

ID Name
1 Rebecca
2 Ashley
3 Rachel
4 Emily
5 Nancy
6 Alice
7 Andrew
8 Janet
9 Sunny
10 Margaret
11 Steven
12 Michael
13 Robert
14 Laura
15 Anne
16 Peter

成绩表:

Name Score
Andrew 70
Ashley 74
Emily 68
Janet 63
Laura 98
Margaret 76
Michael 80
Nancy 99
Rachel 91
Robert 50
Steven 84

脚本:

A
1 =T(“students.xlsx”)
2 =T(“score.xlsx”).align(A1:Name,Name)

A2 使用 align 函数,将成绩表按学生名单表对齐,对齐规则是 Name 字段相等

运行结果:

Name Score
Rebecca
Ashley 74
Rachel 91
Emily 68
Nancy 99
Alice
Andrew 70
Janet 63
Sunny
Margaret 76
Steven 84
Michael 80
Robert 50
Laura 98
Anne
Peter