Array Transformation functions

ZINS (Zeros Insert)

Reference

» Reference, Discussion, & Example Applications:

About

Inserts 1 or more zeros to a sequence of n elements.

Inputs:

  • n : nr. of elements
  • x : element’s group size
  • g : 0’s group size

Code

M.S. Excel
ZINS = LAMBDA(n, x, g,
    LET(
        t, TOCOL(
            IFNA(EXPAND(WRAPROWS(SEQUENCE(n), x), , g + x), 0)
        ),
        TAKE(t, XMATCH(n, t))
    )
);