Google 工作表:IF 语句 - 如果复杂条件为真,则输出另一个单元格的数据

Google Sheets: IF statement - If complex conditions are true, output another cell's data

在我的 Google Sheet 中,我使用 =AVERAGE() 得到了我所有的考试成绩,我的平均成绩。在这些平均值中,我可以使用 =MAX() 来查看哪个是最高的,使用 =MIN() 可以看到哪个是最低的。我想为一个单元格创建一个代码:

  1. 无论哪个百分比最高,它都会输出主题值(它旁边的列)。
  2. 然后,我想要另一个打印“最高平均值:主题 | 百分比”的代码(我认为我可以编写代码)

我能做什么?

My Google Sheet(“Sheet 5”是导入的范围)。同样table如下:

Percentage Subject
65.1428571428572% Biology
66% Chemistry
37.2549019607843% Physics
75% French
58.6206896551724% Geography
81.7058823529412% English
77.6923076923077% Maths
94.1741071428569% Computer Science
78.7435897436% D&T

尝试

=query(A:B,"select * order by A desc limit 1 ",0)

="Highest Average: "& query(A:B,"select B order by A desc limit 1 ",0)  &" | Percentage " &text(query(A:B,"select A order by A desc limit 1 ",0),"0.00%")

=query(A2:B,"select * where A is not null order by A asc limit 1 ",0)

="Lowest Average: "&
query(A2:B,"select B where A is not null order by A asc limit 1 ",0)  &
" | Percentage " &
text(query(A2:B,"select A where A is not null order by A asc limit 1 ",0),"0.00%")

使用:

={"Highest Average: "&JOIN(" | ", INDEX(TEXT(SORT({B:B, A:A}, 2, 0), {"@", "#.00%"}), 1));
  "Lowest Average: "& JOIN(" | ", INDEX(TEXT(SORT({B:B, A:A}, 2, 1), {"@", "#.00%"}), 1))}