Forum

Notifications
Clear all

String of numbers to one cell

7 Posts
3 Users
0 Reactions
68 Views
(@dpal)
Posts: 7
Active Member
Topic starter
 

Is there a formula to string multiple cells either work or numbers to one cell

A1  example A1 to = string to look like  (12,15,658)  - with or without brackets()

A1 pulling from cell B1(12), B2(15), B3(658)

 

Thanks

 
Posted : 09/01/2020 2:47 pm
(@purfleet)
Posts: 412
Reputable Member
 

Depends what version of excel you are running - Office 365 or 2019 you can use Textjoin and it is perfect for what you are asking

textjoin.png

Older versions you would have to manually join, which is okay if you only have a couple of numbers to join

textjoin_old.png

it is also possible to cheat if it is only done occasionally

In the results cell type = then select the range, while in edit mode highlight the formula in the formula bar and press f9 to evaluate the formula, remove the = and the numbers are seperated with a semi colon

textjoin_cheat.png

I am sure there are other options that i have missed

 
Posted : 09/01/2020 4:35 pm
(@dpal)
Posts: 7
Active Member
Topic starter
 

Thank you 

textjoin_old.png worked 

textjoin.png came up as  #NAME?           =TEXTJOIN(",",TRUE,R223:R248)

 
Posted : 09/01/2020 5:20 pm
(@purfleet)
Posts: 412
Reputable Member
 

textjoin came up with the name error as you must be on an older version of excel

 
Posted : 10/01/2020 2:37 am
(@dpal)
Posts: 7
Active Member
Topic starter
 

yes 2016

guess I have to upgrade 

thanks

 
Posted : 10/01/2020 9:16 am
Anders Sehlstedt
(@sehlsan)
Posts: 972
Prominent Member
 

Here is a good list showing all Excel functions and from which version they are available.

 
Posted : 10/01/2020 5:24 pm
(@purfleet)
Posts: 412
Reputable Member
 

If you cant upgrade then a small macro can do the same thing as textjoin

Sub StringOfNumbtoCell()

Dim NumsRange As Range
Dim NumsCell As Range
Dim D As String
Dim Output As String

D = Range("b1")

Range("d1").ClearContents

Set NumsRange = Range("A:A")

For Each NumsCell In NumsRange
Output = Output & NumsCell & D
If NumsCell = "" Then
Output = Left(Output, Len(Output) - 2)
Range("d1") = Output
Exit Sub
End If

Next NumsCell

End Sub

 
Posted : 12/01/2020 2:43 am
Share: