+ Reply to Thread
Results 1 to 7 of 7

How to concatenate mutiple rows and show it in a single Cell Conditionally

  1. #1
    Forum Contributor
    Join Date
    12-17-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    137

    How to concatenate mutiple rows and show it in a single Cell Conditionally

    Team,

    I have a requirement in Excel do concatenate multiple rows of column D (D2 to D100) one below the other and show it in a single cell E2. So for that I have applied the formula in E2 as below.

    Formula

    =D2&"
    "&D3&"
    "&D4&"
    ....
    ....

    "&D99&"
    "&D100&""

    But my requirement is not fixed i.e (1 to 100). it is conditionally based if we have upto 60 rows, we have to write the above formula upto D60.

    Is there anyway we can write a function to concatenate mutiple rows (D2 to D1000) upto a fixed number 1000 and if the text do not appear in the Cells we should not show it in Cell E2 conditionally.

    Thanks!
    Kiran

  2. #2
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: How to concatenate mutiple rows and show it in a single Cell Conditionally

    Hi Kandavalli,

    This code shall suffice your requirements... No changes are required.

    Just paste this in a standard module and assign it to a button.

    Rename the Sheet name if your sheet name isn't Sheet1.

    Please Login or Register  to view this content.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: How to concatenate mutiple rows and show it in a single Cell Conditionally

    Heres a function. Place code in a standard module use the formula below in any cell.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Forum Contributor
    Join Date
    12-17-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    137

    Re: How to concatenate mutiple rows and show it in a single Cell Conditionally

    Hi Mike,

    I almost there, The result should come one below the other.

    Instead of like this

    Result 1, Result 2, Result 3.....

    I need the output like this in a single Cell E2.

    Result 1
    Result 2
    Result 3
    ....
    ...

  5. #5
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: How to concatenate mutiple rows and show it in a single Cell Conditionally

    Change this line in the code, and set the cell to wrap text

    Please Login or Register  to view this content.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,525

    Re: How to concatenate mutiple rows and show it in a single Cell Conditionally

    1) Vertical concatenate
    =Vconc(A1:A1000,CHAR(10))
    Please Login or Register  to view this content.
    2) Horizontal Concatenane
    =HConc(A12:Z12,CHAR(10))
    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-17-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    137

    Re: How to concatenate mutiple rows and show it in a single Cell Conditionally

    Thanks a lot Mike. The solution got worked.

    Thanks Again

    Can I have your gmail ID please.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 07-10-2013, 06:27 PM
  2. [SOLVED] Concatenate rows into single cell, but remove last comma from row
    By djm601 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-13-2013, 09:45 AM
  3. [SOLVED] Splitting mutiple data in a single cell
    By grumpyguppy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-12-2013, 12:15 PM
  4. Replies: 1
    Last Post: 08-24-2012, 05:52 AM
  5. Pasting mutiple paragraph text into a single cell
    By Peter Wells in forum Excel General
    Replies: 2
    Last Post: 06-24-2005, 10:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1