0

I have a sheet need to be split and transpose, the other col will be duplicated by the number of Reps and the other column Only the first record from each rep gets copied, the "repeat" is left blank

Heres the sheet for your reference https://docs.google.com/spreadsheets/d/1IhjE3r6DpOF-tcnzk9ITvLLLv-8KzyMVJ-2BM3_8KRM/edit#gid=2086741331

https://docs.google.com/spreadsheets/d/1IhjE3r6DpOF-tcnzk9ITvLLLv-8KzyMVJ-2BM3_8KRM/edit#gid=2086741331

1
  • @rockinfreakshow I have new data sheet, can you try it there? I lost track when there are multiple columns. thank you "new" sheet in the file Commented Apr 3, 2024 at 8:18

1 Answer 1

0

You may try:

=reduce(A1:G1,F2:F6,lambda(a,c,ifna(vstack(a,if(c="",tocol(,1),let(Σ,split(c,"; ",0),a,offset(c,,-5),g,offset(c,,1),Λ,counta(Σ),hstack(wrapcols(a,Λ,a),offset(c,,-4,,4),tocol(Σ),wrapcols(g,Λ,g))))))))

enter image description here

UPDATED FORMULA:

=reduce(A1:J1,B2:B3,lambda(a,c,ifna(vstack(a,if(c="",tocol(,1),let(Σ,split(c,"; ",0),a,offset(c,,-1),cdef,offset(c,,1,,4),ij,offset(c,,7,,2),Λ,counta(Σ),hstack(wrapcols(a,Λ,a),tocol(Σ),chooserows(cdef,sequence(Λ,1,1,0)),offset(c,,5,,2),chooserows(ij,sequence(Λ,1,1,0)))))))))
Sign up to request clarification or add additional context in comments.

2 Comments

I have new data sheet, can you try it there? I lost track when there are multiple columns. thank you "new" sheet in the file
try the updated formula added to the answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.