Array Transformation functions
MULTIPLY_EVERY_4_CELLS
Reference
» N/A
About
Multiplies every 4 cells, cumulatively, and horizontally, from an array of cells.
Inputs:
- horizontal_vector : horizontal vector with values to multiply
Code
M.S. Excel
MULTIPLY_EVERY_4_CELLS = LAMBDA(horizontal_vector,
LET(
arr, horizontal_vector,
idx, SEQUENCE(, COLUMNS(arr), 1, 1),
select, MOD(idx - 1, 4) + 1,
scan1, IF(select = 1, SCAN(1, IF(select = 1, INDEX(arr, , idx), 1), LAMBDA(a, r, a * r)), 0),
scan2, IF(select = 2, SCAN(1, IF(select = 2, INDEX(arr, , idx), 1), LAMBDA(a, r, a * r)), 0),
scan3, IF(select = 3, SCAN(1, IF(select = 3, INDEX(arr, , idx), 1), LAMBDA(a, r, a * r)), 0),
scan4, IF(select = 4, SCAN(1, IF(select = 4, INDEX(arr, , idx), 1), LAMBDA(a, r, a * r)), 0),
scan1 + scan2 + scan3 + scan4
)
);
Feedback
Submit and view feedback