Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
194 views
in Technique[技术] by (71.8m points)

Splitting rows and moving to csv lines in Excel

I have data looking like this:

John
1231231234
[email protected]
Bob
1241241244
[email protected]

I would like to have it look like this

john, 1231231234, [email protected]
Bob, 1241241244, [email protected]

What's the easiest way to do so in Excel?

question from:https://stackoverflow.com/questions/65602552/splitting-rows-and-moving-to-csv-lines-in-excel

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Note this assumes 3 cells per as a pattern:

Office 365/2019:

=TEXTJOIN(", ",TRUE,INDEX(A:A,(ROW($ZZ1)-1)*3+1):INDEX(A:A,(ROW($ZZ1)-1)*3+3))

enter image description here

Older:

=IF(INDEX(A:A,(ROW($ZZ1)-1)*3+1)<>"",INDEX(A:A,(ROW($ZZ1)-1)*3+1) & ", " & INDEX(A:A,(ROW($ZZ1)-1)*3+2) & ", " & INDEX(A:A,(ROW($ZZ1)-1)*3+3),"")

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...