0

我尝试编写一个基于数据库的简单随机器,用于随机组合数据。这在 Excel 中可以正常工作,但在 Google 表格中却不行,因为没有aggregat

我已经尝试过了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,我查找的其他解决方案对我不起作用。

4

1 回答 1

0

在 Google 表格中,有多个可以模仿的公式,AGGREGATE例如QUERY, FILTER, VLOOKUP, HLOOKUP, LOOKUP, INDEX/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

于 2019-05-24T10:11:38.523 回答