Combine two columns using multiple selections

nigelrs

New Member
Joined
Jun 12, 2013
Messages
2
Hello,

I have struggled with this one and I am not a coder, was looking for some code or assistance. I have 2 columns:

A1 Shirt B1 Blue
A2 Jumper B2 Red
A3 Socks B3 Green
A4 Hat B4 White

I want it to go to the first line in A1 and then combine with every line in column B, so you have Shirt Blue, Shirt Red, Shirt Green, Shirt White. The go to line A2 and repeat with Jumper Blue, Jumper Red, Jumper Green, Jumper White. There are several hundreds of items in both column A & B - which will give a total combination of over 500,000 item combinations.

I cannot find a way to concatenate these easily. Any advise appreciated.
 

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
you could try:

C2 = A1&" "&B$1", "&A1&" "&B$2", "&A1&" "&B$3", "&A1&" "&B$4
then drag it down.
That will give you Shirt Blue, Shirt Red, Shirt Green, Shirt White in one cell.
and for each cell under it will combine the same 4 variables, with a different Start.
If they need to be in different cells.

C2 = A1&" "&B$1
D2 = A1&" "&B$2
E2 = A1&" "&B$3
F2 = A1&" "&B$4

Then drag down.

Hope that helps.
 
Upvote 0
you could try:

C2 = A1&" "&B$1", "&A1&" "&B$2", "&A1&" "&B$3", "&A1&" "&B$4
then drag it down.
That will give you Shirt Blue, Shirt Red, Shirt Green, Shirt White in one cell.
and for each cell under it will combine the same 4 variables, with a different Start.
If they need to be in different cells.

C2 = A1&" "&B$1
D2 = A1&" "&B$2
E2 = A1&" "&B$3
F2 = A1&" "&B$4

Then drag down.

Hope that helps.

Thanks for your feedback - trust someone to give me feedback from the same city I was born in half way around the world!
 
Upvote 0
Hello,

I have struggled with this one and I am not a coder, was looking for some code or assistance. I have 2 columns:

A1 Shirt B1 Blue
A2 Jumper B2 Red
A3 Socks B3 Green
A4 Hat B4 White

I want it to go to the first line in A1 and then combine with every line in column B, so you have Shirt Blue, Shirt Red, Shirt Green, Shirt White. The go to line A2 and repeat with Jumper Blue, Jumper Red, Jumper Green, Jumper White. There are several hundreds of items in both column A & B - which will give a total combination of over 500,000 item combinations.

I cannot find a way to concatenate these easily. Any advise appreciated.
Put this formula in cell C1 and copy it across until it produces a blank cell (actually, you can copy it across even further if you think the list in Column B might grow), then copy all those cells down at least to the bottom of the list in Column A (you can copy them down even further is you expect the list in Column A to grow)...

=IF(OR(A1="",COLUMN()-2>COUNTA($B:$B)),"",$A1&" "&INDEX($B:$B,COLUMN()-2))
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,180
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top