Cancatenate Multiple Cells in Rows

slohman

Board Regular
Joined
Mar 31, 2012
Messages
110
Is there a way to concatenate multiple rows if A2:A6 is True then concatenate B2:C6 with DASH into E2 with a COMMA in between.

[TABLE="width: 893"]
<tbody>[TR]
[TD]A1[/TD]
[TD]B1[/TD]
[TD]C1[/TD]
[TD] [/TD]
[TD]E1[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD]SW57[/TD]
[TD]Swing Post Double[/TD]
[TD][/TD]
[TD]SW57 - Swing Post Double, SW84 - St Swing Post Double (electro-polished), etc[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD]SW84[/TD]
[TD]St Swing Post Double (electro-polished)[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD]SW84-1[/TD]
[TD]St Swing Post Double (Powder-coated)[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD]SW65[/TD]
[TD]Swing Post Triple (2+1)[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD]SW130[/TD]
[TD]Swing Post 4 Bay Snr/Jnr[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col span="2"><col><col><col></colgroup>[/TABLE]

TIA
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Yes, if you have Office 365, TEXTJOIN function will solve this problem very easily.
 
Upvote 0
The formula looks like:

Code:
=TEXTJOIN(",",,IF(A1:A5,B1:B5,""))

Ctrl shift enter for the array formula.

"," measn the delimiter is ",", TEXTJOIN will concatenate B1:B5 if A1:A5 is TRUE.

formula returns:1,3,4 for below table.

[TABLE="width: 160"]
<colgroup><col width="80" span="2" style="width:60pt"> </colgroup><tbody>[TR]
[TD="width: 80, align: center"]TRUE[/TD]
[TD="width: 80, align: right"]1[/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="align: right"]3[/TD]
[/TR]
[TR]
[TD="align: center"]TRUE[/TD]
[TD="align: right"]4[/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: right"]5[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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