ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Create comma-delimited string from dynamic range? (https://www.excelbanter.com/excel-discussion-misc-queries/167261-create-comma-delimited-string-dynamic-range.html)

Ptyrider

Create comma-delimited string from dynamic range?
 
I have a column of student ID numbers, a list of indefinite length,
like this:

A
40001
40003
40004
40008
..
..
..

And I just need to create a string from these numbers, comma
delimited, in another cell for use elsewhere. The above would become:
40001,40003,40004,40008.

If the list were not of indefinite length (but not more than, say,
10), it would be very trivial indeed. I can create a dynamic range,
but don't know what to do with it for this application. Any
suggestions for a slick efficient way to get that string via formula?
Or should I just go for a macro to loop through the range?

pinmaster

Create comma-delimited string from dynamic range?
 
Hi,

Here's one way:

Insert or use a blank column, then if your data starts in A1 in b2 type:
=A1&","&A2, in B3 type: =B2&","&A3, copy B3 to the last data cell which you
can then copy and paste, delete the column when done.

Hope this helps!
Jean-Guy

"Ptyrider" wrote:

I have a column of student ID numbers, a list of indefinite length,
like this:

A
40001
40003
40004
40008
..
..
..

And I just need to create a string from these numbers, comma
delimited, in another cell for use elsewhere. The above would become:
40001,40003,40004,40008.

If the list were not of indefinite length (but not more than, say,
10), it would be very trivial indeed. I can create a dynamic range,
but don't know what to do with it for this application. Any
suggestions for a slick efficient way to get that string via formula?
Or should I just go for a macro to loop through the range?


Ptyrider

Create comma-delimited string from dynamic range?
 
Thanks, not a bad idea!

pinmaster wrote:
Hi,

Here's one way:

Insert or use a blank column, then if your data starts in A1 in b2 type:
=A1&","&A2, in B3 type: =B2&","&A3, copy B3 to the last data cell which you
can then copy and paste, delete the column when done.

Hope this helps!
Jean-Guy

"Ptyrider" wrote:

I have a column of student ID numbers, a list of indefinite length,
like this:

A
40001
40003
40004
40008
..
..
..

And I just need to create a string from these numbers, comma
delimited, in another cell for use elsewhere. The above would become:
40001,40003,40004,40008.

If the list were not of indefinite length (but not more than, say,
10), it would be very trivial indeed. I can create a dynamic range,
but don't know what to do with it for this application. Any
suggestions for a slick efficient way to get that string via formula?
Or should I just go for a macro to loop through the range?



All times are GMT +1. The time now is 02:19 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com