具有大型功能的Google表格是否有很好的汇总表?

时间:2019-05-24 09:56:03

标签: random google-sheets aggregate google-sheets-formula textjoin

我尝试编写一个基于数据库的简单随机数发生器,用于随机组合数据。由于没有aggregat

,因此在Excel中效果很好,但在Google表格中效果不佳

我已经尝试过LARGEMAX,但是它没有随机化,并且使用SUBTOTAL不能正常工作。我以为它也可以基于ROW,但也许我有一个错误的概念。

excel中的代码是这样的(我使用的是德语版本的Excel,但这应该是英语的等效版本)

=TEXTJOIN(" ";TRUE;INDIRECT("A"&ROUNDUP(RAND()*AGGREGAT(14;4;(A:A<>"")*ROW(A:A);1);0));INDIRECT("B"&ROUNDUP(RAND()*AGGREGAT(14;4;(B:B<>"")*ROW(B:B);1);0));INDIRECT("C"&ROUNDUP(RAND()*AGGREGAT(14;4;(C:C<>"")*ROW(C:C);1);0)))

正如我所提到的,没有aggregat,而且我查找的其他解决方案对我来说都不起作用。

1 个答案:

答案 0 :(得分:0)

在Google表格中,有多个可以模仿AGGREGATE的公式,例如QUERYFILTERVLOOKUPHLOOKUPLOOKUPINDEX / MATCH,并且取决于所提到的最适合的任务。


=INDEX(INDIRECT("A1:A"&COUNTA(A1:A)); RANDBETWEEN(1; COUNTA(A1:A)))

0


=INDEX({INDIRECT("A1:A"&COUNTA(A1:A))\
        INDIRECT("B1:B"&COUNTA(B1:B))\
        INDIRECT("C1:C"&COUNTA(C1:C))}; RANDBETWEEN(1; COUNTA(A1:A)))

0


={INDEX(INDIRECT("A1:A"&COUNTA(A1:A)); RANDBETWEEN(1; COUNTA(A1:A)))\
  INDEX(INDIRECT("B1:B"&COUNTA(B1:B)); RANDBETWEEN(1; COUNTA(B1:B)))\
  INDEX(INDIRECT("C1:C"&COUNTA(C1:C)); RANDBETWEEN(1; COUNTA(C1:C)))}

3


=INDEX({INDIRECT("A1:A"&COUNTA(A1:A));
            INDIRECT("B1:B"&COUNTA(B1:B));
            INDIRECT("C1:C"&COUNTA(C1:C))}; RANDBETWEEN(1; COUNTA(A1:C)))

4


=JOIN(" "; {PROPER(
 INDEX(INDIRECT("A1:A"&COUNTA(A1:A)); RANDBETWEEN(1; COUNTA(A1:A))))\
 INDEX(INDIRECT("B1:B"&COUNTA(B1:B)); RANDBETWEEN(1; COUNTA(B1:B)))\
 INDEX(INDIRECT("C1:C"&COUNTA(C1:C)); RANDBETWEEN(1; COUNTA(C1:C)))})&"."

0