WISDOMBYDATA
  • BLOG
    • Blog Guide
    • Blog History
  • EXCEL
    • Functions & Formulas
    • VBA & Macros
    • VLOOKUP
    • Pivot Tables
    • Conditional Formatting
    • Tricks & Shortcuts
  • BI
    • SAP BOBJ/BW
    • Tableau
  • SQL
  • ABOUT
    • About WBD
    • About Me

How to convert a column into a comma-delimited list in MS Excel

5/7/2017

0 Comments

 

Comma delimited data lists are often used as input for platforms such as SAP Business Objects, Java, Visual basics, etc. Here is the procedure for creating a comma delimited list:

STEP 1] Concatenate the first two data entries in the list by typing:  =A2&”,”&A3
Here is a depiction were I have applied this for a list of Order IDs
Picture
STEP 2] Go to the cell below the cell in step 1 and enter the following formula there:
=C2&","&A4

Here is a depiction. What this formula does is that it concatenates the third column entry with the already concatenate two values of the column.

Picture
STEP 3] Drag down the formula in step 2 so it covers the entire range. Here is how it will look like after you apply the formula to the full range.
Picture
As you could observe in the image above the delimited data has been generated correctly. While this approach is very effective, it does have one short-coming:  each cell in MS Excel could contain no more than 1024 characters. In other words the maximum length of a cell in MS Excel is equal to 1024.

This shortcoming has affected our comma delimited list as follows:
Picture
As you could see in the screenshot above, the comma delimited formula has stopped adding “Order ID” values to the list at a certain point (i.e. at row 128) and this is because the cell length would exceed 1024 after this point. Here is the solution to this anomaly:  
 
First] Insert this formula next to the first data entry of the column:         =Len (C2)
And then apply the formula to the entire range. This formula counts the number of characters in the comma delimited cells.
Picture
Second] whenever the length exceeds 1024, reset the formula in column C to the one in STEP 1.
Picture
The number of times you will need to reset your comma delimited formula will depend on the number of data entries you have. For example, In this case I will have two comma-delimited lists which I will merge together in MS word.


0 Comments

Your comment will be posted after it is approved.


Leave a Reply.

    Categories

    All
    BI
    EXCEL
    MISC
    SQL

    Archives

    June 2020
    May 2020
    April 2020
    March 2020
    February 2020
    December 2019
    November 2019
    October 2019
    September 2019
    August 2019
    July 2019
    June 2019
    May 2019
    April 2019
    March 2019
    February 2019
    January 2019
    December 2018
    November 2018
    October 2018
    September 2018
    August 2018
    July 2018
    June 2018
    May 2018
    April 2018
    March 2018
    September 2017
    August 2017
    July 2017
    June 2017
    May 2017
    April 2017
    March 2017
    February 2017
    January 2017
    December 2016
    November 2016
    October 2016
    September 2016
    August 2016
    July 2016
    June 2016
    May 2016
    April 2016
    March 2016
    February 2016
    May 2015
    April 2015
    March 2015
    February 2015
    January 2015
    December 2014
    November 2014
    October 2014
    September 2014
    August 2014
    April 2014
    March 2014
    February 2014
    January 2014
    December 2013
    November 2013

Powered by Create your own unique website with customizable templates.
  • BLOG
    • Blog Guide
    • Blog History
  • EXCEL
    • Functions & Formulas
    • VBA & Macros
    • VLOOKUP
    • Pivot Tables
    • Conditional Formatting
    • Tricks & Shortcuts
  • BI
    • SAP BOBJ/BW
    • Tableau
  • SQL
  • ABOUT
    • About WBD
    • About Me