Array ‘By Element’ functions

ASPLIT

Reference

» Reference, Discussion, & Example Applications:

About

Splits a column array by a delimiter.

Calls AUNQSRT.

Inputs:

  • ar : required. Column array
  • d : required. String or number delimiter

Code

M.S. Excel
ASPLIT = LAMBDA(ar, d,
    LET(
        a, TRIM(ar),
        s, SEQUENCE(, MAX(LEN(a))),
        x, IFERROR(SEARCH(d, d & a, s), ""),
        y, IFERROR(SEARCH(d, a & d, s), ""),
        m, AUNQSRT(x, ),
        n, AUNQSRT(y, ),
        z, IFERROR(TRIM(MID(a, m, n - m)), ""),
        IF(ISERROR(--z), z, --z)
    )
);