DEV Community

Cover image for #24 — Repeat the Value of Each Cell N times According to the Value of the Neighboring cell
Judith-Excel-Sharing
Judith-Excel-Sharing

Posted on

#24 — Repeat the Value of Each Cell N times According to the Value of the Neighboring cell

Problem description & analysis:
The table below has two columns, where column B is the number.

original table
We need to repeat the value of column A N times according to the value of column B and concatenate the results into one column.

desired table
Solution:
Use SPL XLL to do this:

=spl("=?.conj(~2*[~1])",A1:B2)
Enter fullscreen mode Exit fullscreen mode

As shown in the picture below:

result table with code entered
Explanation:
conj() function concatenates members of a sequence; ~2 represents the 2nd child member of the current member; “integer N* sequence” means copying each member of a sequence N times.

Top comments (2)

Collapse
 
judith677 profile image
Judith-Excel-Sharing

Here's information you might be interested in:
🔸SPL download address: scudata.com/download-Desktop
🔹Plugin Installation Method: c.scudata.com/article/1652061135502
🔸References to other rich Excel operation cases: c.raqsoft.com/article/1651916536524
🔹SPL Programming (YouTube FREE courses): youtube.com/playlist?list=PLQeR-Ih...

Some comments may only be visible to logged-in visitors. Sign in to view all comments.