Forum Discussion
djclements
Sep 22, 2025Silver Contributor
Rack of Lambda
There’s been a lot of content shared recently to commemorate the upcoming 40th anniversary of Microsoft Excel. Personally, I’ve only been using Excel for around half that time, but October also marks...
djclements
Sep 27, 2025Silver Contributor
Personally, I don't think a new function is warranted for the delimited values example, as you can simply combine UNPIVOT with TEXTTOCOLS to achieve the desired results. There was actually an example of this (albeit a bit hidden) in cell V3 of the InstanceNum worksheet in my original sample file. With this new example, though, you could try the following:
=UNPIVOT(B4:C6,,TEXTTOCOLS(D4:D6,", "),,1)If you don't like that "ColumnID" is included in the final output, use CHOOSECOLS to remove it (see attached sample file).
The second example, I would say, is more closely related to my REPTA function, or even the PMTSUMMARY function that we drafted yesterday. As a matter of fact, you can use PMTSUMMARY to achieve the desired results:
=DROP(PMTSUMMARY(B14:D16,1,D14:D16,,1),,-1)However, this function is somewhat overkill for this particular scenario because all that's really needed is TOCOL-IF(S)-SEQUENCE with or without CHOOSEROWS:
REPTROWS = LAMBDA(fields,number_times,
CHOOSE(
1 + (COLUMNS(fields) = 1) + (TYPE(number_times) = 64) * 2,
CHOOSEROWS(fields, TOCOL(IF(SEQUENCE(, number_times), SEQUENCE(ROWS(fields))))),
TOCOL(IF(SEQUENCE(, number_times), fields)),
CHOOSEROWS(fields, TOCOL(IFS(number_times >= SEQUENCE(, MAX(number_times)), SEQUENCE(ROWS(fields))), 2)),
TOCOL(IFS(number_times >= SEQUENCE(, MAX(number_times)), fields), 2)
)
)The syntax would then simply be:
=REPTROWS(B14:D16,D14:D16)Cheers!
Harun24HR
Sep 27, 2025Silver Contributor
Great! Thank you so much. I will study rack of lambdas all formulas.