New Google spreadsheet Concatenate limit 50000 characters

后端 未结 3 2178
无人共我
无人共我 2020-12-02 01:03

Migrating to new Google spreadsheets. I have a custom formula that combines a few arrays into one array

=TRANSPOSE(SPLIT(ARRAYFORMULA(CONCATENATE(\'Monthly lin

3条回答
  •  时光说笑
    2020-12-02 01:33

    My answer is related to another similar Q, marked as duplicete:

    Text result of JOIN is longer than the limit of 50000 characters

    My solution is to use the formula:

    =query(joinSplit(A2:A, ";"), "select Col1, count(Col1) group by Col1", 0)

    where joinSplit(A2:A, ";") is a custom formula.

    The code to paste into script editor is:

    function joinSplit(column, delim)
    {
      var result = [];
      var row = [];
      for (var i = 0, l = column.length; i < l; i++)
      {
        row = column[i].join(delim).split(delim);
        row.forEach( function(elt) { result.push([elt]); } ); 
      }  
      return result;
    }
    

    It will return the column of unique items.

    If data is:

    A;B;C;D
    D;D
    E;F;A;A
    G;A;B;C
    

    The result is column:

    A
    B
    C
    D
    D
    D
    E
    F
    A
    A
    G
    A
    B
    C
    

提交回复
热议问题