Expand Multi-Row Text in A Cell to Multiple Cells
Judith-Excel-Sharing
Posted on July 11, 2024
Problem description & analysis:
In the following table, column A is the category, and column B includes one or multiple lines of text where the line break is the separator.
The task is to expand each multi-line cell under column B into multiple cells and copy the column A value.
Solution:
Use SPL XLL to do this:
=spl("=?.news@q(~2.import@si();[get(1)(1),~])",A2:B4)
As shown in the picture below:
news@q function generates a new sequence by computing members of an existing sequence; ~2 is the 2ndmember of the current variable; import@si parses a string into a sequence of single-line strings according to the carriage return; get() function returns the loop variable according to the layer number during a multilayer loop.
Posted on July 11, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 23, 2024
July 16, 2024