Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9624

Splitting multi-line cells with formulas - syntax problems

$
0
0

I have a data set, that is constantly updated/changing, that I would like to have one column's data separated into multiple rows (and copying adjacent columns to the rows);

I tried to use a script and loop but found I had errors when the records list gets too big. Then I stumbled on this response I found very useful:
Google sheets split multi-line cell into new rows (+ duplicate surrounding row entries)

unfortunately it is a quite complicated formula and some functions are very new to me. Inevitably I had trouble working with it, even with the example from OP.

I have 5 columns where one column will have a variable number of entries. These entries may contain spaces. I have split them in an array, but I do not understand how to transpose and copy so that it makes new rows.

e.g.:

=ArrayFormula(If(not(isblank($A:A)),SPLIT($B:B,", ",,FALSE),))

and I know I need to copy/transpose, for each row:

=len((SUBSTITUTE(B1,"","")))- (len(SUBSTITUTE(B1,","&"","")))+1

but I do not know how to use the transpose formula well enough in an array formula to get that.

Where the source has a format of: example raw

and the final output would take this form: example final


Viewing all articles
Browse latest Browse all 9624

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>