Array Transformation functions

ABLNKINS

Reference

» Reference, Discussion, & Example Applications:

About

Advance Insert, inserts blank rows/columns, can add row/column headers.

Calls INSBLNKRWS that calls ZINS.

100% cosmetics function, double transpose and headers stacking versatility.

Inputs:

  • ar : array
  • [rc] : rows/clms group size, orientation given by its sign: rc < 0, column orientation; rc > 0, rows orientation; if omitted rc = 1
  • [g] : gap size: if omitted g = 1; if < 0 gap still inserted, but before 1st row or 1st clm
  • [h] : row/column headers array, if omitted no stacking

Code

M.S. Excel
ABLNKINS = LAMBDA(ar, [rc], [g], [h],
    LET(
        a, IF(ar = "", "", ar),
        x, IF(rc, ABS(rc), 1),
        f, rc < 0,
        b, IF(f, TRANSPOSE(a), a),
        c, INSBLNKRWS(b, x, g),
        d, IF(f, TRANSPOSE(c), c),
        IF(AND(h = ""), d, IF(f, HSTACK(h, d), VSTACK(h, d)))
    )
);