Joining text in one cell

  • Thread starter Thread starter ca.ankitgarg
  • Start date Start date
C

ca.ankitgarg

hi all of you

i want to join text values given in various cells into one cell.

for example i have data as follows

Row 1 Ankit
Row 2 Garg
Row 3 Chartered
Row 4 Accountant
Row 4 Delhi
Row 5 India

and the desired result is as follows

Row 6 Ankit Garg Chartered Accountant Delhi India

also if i want to insert any comma or semicolon between these text
values like

Row 6 Ankit, Garg, Chartered, Accountant, Delhi, India,

kindly suggest any method or formula for this

thanks in advance
Ankit Garg
India
 
Hi

A rather long-winded formula:

=A1&A2&A3&A4&A5

if you want commas or other delimiters (such as spaces) then:

=A1 & "," & A2 & "," & A3 & "," & A4 & "," & A5

Hope this helps!

Richard
 
hi all of you

i want to join text values given in various cells into one cell.

for example i have data as follows

Row 1 Ankit
Row 2 Garg
Row 3 Chartered
Row 4 Accountant
Row 4 Delhi
Row 5 India

and the desired result is as follows

Row 6 Ankit Garg Chartered Accountant Delhi India

also if i want to insert any comma or semicolon between these text
values like

Row 6 Ankit, Garg, Chartered, Accountant, Delhi, India,

kindly suggest any method or formula for this

thanks in advance
Ankit Garg
India

In addition to the formula posted, you could download and install Longre's free
morefunc.xll add-in from:

Then use the formula:

=MCONCAT(A1:A6," ")

or, with <comma><space>:

=MCONCAT(A1:A6,", ")


--ron
 
Ankit

If you want go with VBA...............you can choose the delimiter(s) you wish.

Sub ConCat_Cells()
Dim x As Range
Dim y As Range
Dim z As Range
Dim w As String
Dim sbuf As String
On Error GoTo endit
w = InputBox("Enter the Type of De-limiter Desired")
Set z = Application.InputBox("Select Destination Cell", _
"Destination Cell", , , , , , 8)
Application.SendKeys "+{F8}"
Set x = Application.InputBox("Select Cells, Contiguous or Non-Contiguous", _
"Cells Selection", , , , , , 8)
For Each y In x
If Len(y.text) > 0 Then sbuf = sbuf & y.text & w
Next
z = Left(sbuf, Len(sbuf) - 1)
Exit Sub
endit:
MsgBox "Nothing Selected. Please try again."
End Sub


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top