Concatenate a variable range of cells
Solved
texastina
Posted messages
55
Status
Membre
-
texastina Posted messages 55 Status Membre -
texastina Posted messages 55 Status Membre -
Hello everyone,
Thank you in advance for your help!
You will find below the link to my Excel table,
My problem is as follows: I would like, as shown in the photo, for all the numbers (in column B) corresponding to product A to be concatenated in column F, and the same for the numbers of products B and C.
I have deliberately simplified my table to "see more clearly," but in reality, my table has a variable number of rows, and a product A, B, or C does not necessarily have multiple numbers. I am therefore looking for a VBA method or formula to automate this data processing.
https://www.cjoint.com/c/HAzqLy2V4Nx
Thank you very much for your help!
Thank you in advance for your help!
You will find below the link to my Excel table,
My problem is as follows: I would like, as shown in the photo, for all the numbers (in column B) corresponding to product A to be concatenated in column F, and the same for the numbers of products B and C.
I have deliberately simplified my table to "see more clearly," but in reality, my table has a variable number of rows, and a product A, B, or C does not necessarily have multiple numbers. I am therefore looking for a VBA method or formula to automate this data processing.
https://www.cjoint.com/c/HAzqLy2V4Nx
Thank you very much for your help!
1 réponse
Hello Texastina
Try this if I understood your problem correctly
=CHOOSE(IF(A2="A",1,IF(A2="b",2,IF(A2="c",3,IF(A2="d",4,IF(A2="e",5,6)))));$B$2&$B$3&$B$4&$B$5&$B$6&$B$7;$B$8&$B$9&$B$10&$B$11&$B$12&$B$13;$B$14&$B$15&$B$16;$B$17;$B$18&$B$19;$B$20&$B$21&$B$22&$B$23)
--
It's by forging that one becomes a blacksmith. - It's at the foot of the wall that one sees the mason - we always learn from our mistakes.
Try this if I understood your problem correctly
=CHOOSE(IF(A2="A",1,IF(A2="b",2,IF(A2="c",3,IF(A2="d",4,IF(A2="e",5,6)))));$B$2&$B$3&$B$4&$B$5&$B$6&$B$7;$B$8&$B$9&$B$10&$B$11&$B$12&$B$13;$B$14&$B$15&$B$16;$B$17;$B$18&$B$19;$B$20&$B$21&$B$22&$B$23)
--
It's by forging that one becomes a blacksmith. - It's at the foot of the wall that one sees the mason - we always learn from our mistakes.
Thank you for your response, it works very well,
However, since the number of rows remains significant, I needed a formula that could be dragged down and updated, so I played with the IF functions and found my solution,
My formulas: In C2 =IF(A2=A3,B2," "&C3&B2) In D2 =IF(A2<>A1,C2,"")
Thanks again, have a great day,