hellothere4
New Member
- Joined
- May 9, 2011
- Messages
- 17
Hello, I can have 3 examples of matrixes of cells, and the initial input and output:
input
(1)
a1 b1 c1 d1
a2 b2 c2 d2
(2)
a1 b1 c1 d1 e1
a2 b2 c
(3)
a1 b1 c1 d1 e1
a2 b2 c2 d2 e2
a3 b3 c3 d3 e3
a4 b4 c4 d4 e4
a5
output
(1)
(a1,b1,c1,d1)
(a2,b2,c2,d2)
(2)
(a1,b1,c1,d1,e1)
(a2,b2)
(3)
(a1,b1,c1,d1,e1)
(a2,b2,c2,d2,e2)
(a3,b3,c3,d3,e3)
(a4,b4,c4,d4,e4)
(a5)
and I want to be able to merge/replace the rows so that the first cell looks like this (a1,b1,c1,d1,e1). Now, I could do A1 ="("&a1&","&....","&e1&")" however I need the merge to work without needing to know the number of columns, which could be 1,4,20. And then, I need it to move down and repeat the step until it reaches a cell in column 1 which has no data. So, there are really two places I need help, merging with a dynamic number of columns, and then repeating this through a dynamic number of rows. Thanks for the help
input
(1)
a1 b1 c1 d1
a2 b2 c2 d2
(2)
a1 b1 c1 d1 e1
a2 b2 c
(3)
a1 b1 c1 d1 e1
a2 b2 c2 d2 e2
a3 b3 c3 d3 e3
a4 b4 c4 d4 e4
a5
output
(1)
(a1,b1,c1,d1)
(a2,b2,c2,d2)
(2)
(a1,b1,c1,d1,e1)
(a2,b2)
(3)
(a1,b1,c1,d1,e1)
(a2,b2,c2,d2,e2)
(a3,b3,c3,d3,e3)
(a4,b4,c4,d4,e4)
(a5)
and I want to be able to merge/replace the rows so that the first cell looks like this (a1,b1,c1,d1,e1). Now, I could do A1 ="("&a1&","&....","&e1&")" however I need the merge to work without needing to know the number of columns, which could be 1,4,20. And then, I need it to move down and repeat the step until it reaches a cell in column 1 which has no data. So, there are really two places I need help, merging with a dynamic number of columns, and then repeating this through a dynamic number of rows. Thanks for the help