CONCATENATE Issue

lal12

New Member
Joined
Mar 30, 2011
Messages
24
Hi, new here. Tried searchign the topic but can't find what I'm looking for. I'm trying to concatenate a string of words across 14 cells. Some cells are blank though. Is there a way to skip the blank cells. Sorry if this is basic but need the help.

Thanks!

Should end up looking like this: House, Milk, Blanket
Looks like this now: , , , House, Milk, , , Blanket

Using this as the formula

=CONCATENATE(F2,", ",G2,", ",H2,", ",I2,", ",J2,", ",K2,", ",L2,", ",M2,", ",N2,", ",O2,", ",P2,", ",Q2,", ",R2,", ",S2)
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Welcome to the forums!

Try out this CONCATRANGE() UDF. To use it, Press Alt+F11 to load the VBA Editor, Go to Insert>Module, Copy/Paste this code into the window that loads up. Then go to your worksheet, and use the formula:

=CONCATRANGE(F2:S2,", ")

Code:
Public Function Concatrange(rng As Range, Optional delimiter As String = "")
   Dim rRng As Range
   
   For Each rRng In rng
      If rRng.Value <> "" Then
         Concatrange = Concatrange & rRng.Value & delimiter
      End If
   Next rRng
   
   If Len(Concatrange) > 0 Then
      Concatrange = left(Concatrange, Len(Concatrange) - Len(delimiter))
   Else
      Concatrange = ""
   End If
   
End Function
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

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