ARRAYFORMULA() does not work with SPLIT()

You can use this script:

function better_split(col, separator) {
  var new_col = [];
  for (var r = 0; r < col.length; r++) {
    if (col[r]) {
      new_col.push(col[r][0].split(separator));
    }
  }
  return new_col;
}

use it like so (for performance reasons):

=better_split(filter(A2:A, len(A2:A)>0), "/")

SPLIT applied to a vertical array does, now, work. (Jan 4 2017)

=ArrayFormula(SPLIT(input!G2:G,","))

or for error masking

=ArrayFormula(IFERROR(SPLIT(input!G2:G,",")))

Note: the resultant array is as wide as the maximum number of SPLITted elements.


(The remainder of the answer no longer applies, but retained for... historical purposes?)

This will be regarded as a really bad answer, but: it just doesn't.

I suspect it might be because it potentially will produce a jagged array (different number of elements in each row), which may be considered problematic. However, an "array SPLIT" used to "work" in the previous version of Sheets (albeit with a bug where it didn't work properly on the first element of the array).

SPLIT is not alone as a function that can't be iterated over an array (eg INDIRECT, INDEX, SUMIFS).


A workaround (edited Jan 4 2017):

=ArrayFormula(REGEXREPLACE(input!G2:G&REPT(",",6),REPT("([^,]*),",6)&",*","$"&COLUMN(OFFSET(A1,,,1,6))))

The 6 in the OFFSET(A1,,,1,6) and the REPT functions determines the maximum number of elements in the SPLIT. You could inject an expression that would calculate the maximum number of elements from the column of data, but then performance would suffer even more.

Also, a caveat here is that it will only support splitting by a single character (in this case a comma).

Alternatively, you could look at a Google Apps Script custom function.


This previous workaround no longer works, as REGEXEXTRACT no longer appears to support an array for the second argument - as it stands in January 2017, anyway.

=ArrayFormula(IFERROR(REGEXEXTRACT(","&input!G2:G,"^"&REPT(",+[^,]+",COLUMN(OFFSET(A1,,,1,6))-1)&",+([^,]+)")))