Forum Discussion
Alex_Barbosa99
Apr 30, 2023Copper Contributor
How to divide cell value in many lines?
Hello, I would like to create a macro to divide cell value in many lines as the following: Input: A 360 B 120 C 240 D 480 E 60 Output: A 120 A 120 A 1...
SergeiBaklan
May 01, 2023Diamond Contributor
As variant
=LET(
repeat, BYROW(data,
LAMBDA(v, LAMBDA(
LET(
n, INT(INDEX(v, 2) / divider),
IF(n, IF(SEQUENCE(n), v), v))
) )
),
first, INDEX(repeat, 1, 1)(),
rest, INDEX(repeat, SEQUENCE(ROWS(repeat) - 1, , 2), 1),
REDUCE(first, rest, LAMBDA(a,v, VSTACK(a, v())))
)