同一公式中的查询,数组和排序函数

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了同一公式中的查询,数组和排序函数相关的知识,希望对你有一定的参考价值。

我有一个从表单中提取数据的ARRAY,然后使用QUERY将行与第1列中的相同数据组合起来,我现在需要按照第2列中的数据按字母顺序排序。我无法弄清楚如何将该方面整合到给定的公式中。

另外,在公式中,我发现在线(这非常有用!),我现在得到的第一行数据在其余数据之前显示“max”,并且在它之后直接显示空行...但我可以'摆脱他们中的任何一个!

任何帮助都会如此受到如此赞赏。

这是我目前正在使用的公式(这是超长的,我无法弄清楚如何突出显示部分 - 对不起!这是“SELECT”以后的最后一个条款导致奇怪的格式化)

=QUERY({ARRAYFORMULA({
 'Raw Data'!C2:C1501&" "&'Raw Data'!D2:D1501,
 'Raw Data'!E2:E1501,
 'Raw Data'!H2:H1501,
 'Raw Data'!J2:J1501&'Raw Data'!K2:K1501&'Raw Data'!L2:L1501&'Raw Data'!M2:M1501&'Raw Data'!AK2:AK1501&'Raw Data'!AL2:AL1501&'Raw Data'!AM2:AM1501&'Raw Data'!AN2:AN1501&'Raw Data'!BF2:BF1501&'Raw Data'!BG2:BG1501&'Raw Data'!BH2:BH1501&'Raw Data'!BI2:BI1501,
 'Raw Data'!N2:N1501&'Raw Data'!Q2:Q1501&'Raw Data'!AO2:AO1501,
 'Raw Data'!P2:P1501&'Raw Data'!R2:R1501&'Raw Data'!AP2:AP1501,
 'Raw Data'!S2:S1501&'Raw Data'!T2:T1501&'Raw Data'!U2:U1535&'Raw Data'!V2:V1535&'Raw Data'!AK2:AK1535&'Raw Data'!AL2:AL1535&'Raw Data'!AM2:AM1535&'Raw Data'!AN2:AN1535&'Raw Data'!BF2:BF1535&'Raw Data'!BG2:BG1535&'Raw Data'!BH2:BH1501&'Raw Data'!BI2:BI1501,
 'Raw Data'!W2:W1501&'Raw Data'!Z2:Z1501&'Raw Data'!AV2:AV1501,
 'Raw Data'!Y2:Y1501&'Raw Data'!AA2:AA1501&'Raw Data'!AW2:AW1501,
 'Raw Data'!AB2:AB1501&'Raw Data'!AC2:AC1501&'Raw Data'!AD2:AD1501&'Raw Data'!AY2:AY1501&'Raw Data'!AZ2:AZ1501&'Raw Data'!BA2:BA1501&'Raw Data'!BN2:BN1501&'Raw Data'!BO2:BO1501&'Raw Data'!BP2:BP1501,
 'Raw Data'!AE2:AE1501&'Raw Data'!AH2:AH1501&'Raw Data'!BB2:BB1501,
 'Raw Data'!AG2:AG1501&'Raw Data'!AI2:AI1501&'Raw Data'!BC2:BC1501,
 'Raw Data'!CG2:CG1501,
 'Raw Data'!G2:G1501,
 'Raw Data'!BY2:BY1501&'Raw Data'!CA2:CA1501&'Raw Data'!CC2:CC1501})},
 "SELECT Col1,"&ArrayFormula(join(", ","Max(Col"&column(B1:O1)&")"))&"group by Col1",1)
答案
=SORT(QUERY(QUERY({ARRAYFORMULA({
 'Raw Data'!C2:C&" "&'Raw Data'!D2:D,
 'Raw Data'!E2:E,
 'Raw Data'!H2:H,
 'Raw Data'!J2:J&'Raw Data'!K2:K&'Raw Data'!L2:L&'Raw Data'!M2:M&'Raw Data'!AK2:AK&'Raw Data'!AL2:AL&'Raw Data'!AM2:AM&'Raw Data'!AN2:AN&'Raw Data'!BF2:BF&'Raw Data'!BG2:BG&'Raw Data'!BH2:BH&'Raw Data'!BI2:BI,
 'Raw Data'!N2:N&'Raw Data'!Q2:Q&'Raw Data'!AO2:AO,
 'Raw Data'!P2:P&'Raw Data'!R2:R&'Raw Data'!AP2:AP,
 'Raw Data'!S2:S&'Raw Data'!T2:T&'Raw Data'!U2:U&'Raw Data'!V2:V&'Raw Data'!AK2:AK&'Raw Data'!AL2:AL&'Raw Data'!AM2:AM&'Raw Data'!AN2:AN&'Raw Data'!BF2:BF&'Raw Data'!BG2:BG&'Raw Data'!BH2:BH&'Raw Data'!BI2:BI,
 'Raw Data'!W2:W&'Raw Data'!Z2:Z&'Raw Data'!AV2:AV,
 'Raw Data'!Y2:Y&'Raw Data'!AA2:AA&'Raw Data'!AW2:AW,
 'Raw Data'!AB2:AB&'Raw Data'!AC2:AC&'Raw Data'!AD2:AD&'Raw Data'!AY2:AY&'Raw Data'!AZ2:AZ&'Raw Data'!BA2:BA&'Raw Data'!BN2:BN&'Raw Data'!BO2:BO&'Raw Data'!BP2:BP,
 'Raw Data'!AE2:AE&'Raw Data'!AH2:AH&'Raw Data'!BB2:BB,
 'Raw Data'!AG2:AG&'Raw Data'!AI2:AI&'Raw Data'!BC2:BC,
 'Raw Data'!CJ2:CJ,
 'Raw Data'!G2:G,
 'Raw Data'!BY2:BY&'Raw Data'!CA2:CA&'Raw Data'!CC2:CC})},
 "select Col1,"&JOIN(", ", "max(Col"&COLUMN(B1:O1)&")")&"
  group by Col1", 0),
 "where Col1 is not null"), 2, 1, 1, 1)

0

以上是关于同一公式中的查询,数组和排序函数的主要内容,如果未能解决你的问题,请参考以下文章

excel vlookup函数怎么查询一个值返回多个结果

对数组中的字符串进行排序,使其稀疏

为什么我不能在此片段中生成唯一对象数组?

二维数组查询算法

二维数组中的查找

0137 函数案例:数组翻转冒泡排序判断闰年