如何对同一单元格中的单元格值进行排名

How to rank a cell value within the same cell

我正在尝试对一组数字(在一列中)进行排名,但我希望该排名显示在同一单元格中数字的旁边。

例如,如果数字是“21”并且排名“第 3”——我希望单元格显示为“21 (3)”。 如果我可以将 (3) 格式化为 smaller/superscript。


我尝试了什么: 虽然我正在使用的单元格中已经有一个方程式,但我将简化它。假设 A23 = 15A24 = 6。我尝试了以下等式,但它一直给我一个错误。我工作的牢房是H103。排名范围是H103:H114.

=SUM(A23+A24) & "(" & RANK(H103,$H3:$H4) & ")"

即使我删除了括号或稍作修改,我仍然会遇到错误。只是想找到任何方法我可以有 2 个公式,在同一个单元格中有不同的结果;其中之一显示该特定单元格的等级。

HERE IS COPY OF MY SHEET — 这是一个重复的 Google Sheet,所以如果你愿意,可以随意在里面玩。我专注于排名 H103:H114.

粘贴到单元格H103:

=ARRAYFORMULA(TEXT(VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!B:C"), 
 "select B,sum(C) where B is not null group by B", 0), 2, 0)+
 VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!E:D"), 
 "select E,sum(D) where E is not null group by E", 0), 2, 0), "#.00")&" "&CHAR(8317)&
 VLOOKUP(RANK(VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!B:C"), 
 "select B,sum(C) where B is not null group by B", 0), 2, 0)+
 VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!E:D"), 
 "select E,sum(D) where E is not null group by E", 0), 2, 0), 
 VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!B:C"), 
 "select B,sum(C) where B is not null group by B", 0), 2, 0)+
 VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!E:D"), 
 "select E,sum(D) where E is not null group by E", 0), 2, 0), 0),  
 {1,  CHAR(185);             2, CHAR(178);            3, CHAR(179);  
  4,  CHAR(8308);            5, CHAR(8309);           6, CHAR(8310);           
  7,  CHAR(8311);            8, CHAR(8312);           9, CHAR(8313); 
  10, CHAR(185)&CHAR(8304); 11, CHAR(185)&CHAR(185); 12, CHAR(185)&CHAR(178)}, 2, 0)&
 CHAR(8318))


粘贴到单元格 I103:

=ARRAYFORMULA(VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!B:C"), 
 "select B,sum(C) where B is not null group by B", 0), 2, 0)+
 VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!E:D"), 
 "select E,sum(D) where E is not null group by E", 0), 2, 0)-C103:C114)

粘贴到单元格 L103:

=ARRAYFORMULA(VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!B:C"), 
 "select B,sum(C) where B is not null group by B", 0), 2, 0)+
 VLOOKUP(B103:B114, QUERY(INDIRECT($A0&"!E:D"), 
 "select E,sum(D) where E is not null group by E", 0), 2, 0)-J103:J114)

H 列的条件格式:

红色颜色自定义公式:

=REGEXMATCH(H103, CHAR(8317)&CHAR(185)&CHAR(178)&CHAR(8318))

绿色颜色自定义公式:

=REGEXMATCH(H103, CHAR(8317)&CHAR(185)&CHAR(8318))