+ Reply to Thread
Results 1 to 13 of 13

Concatenate that remove empty cells

  1. #1
    Registered User
    Join Date
    05-18-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    26

    Concatenate that remove empty cells

    hi all,

    please help me find the right formula for this concatenation.
    here's my sample data;

    sample.JPG

    please take note on the "/" that inserted between the concatenation.

  2. #2
    Forum Expert
    Join Date
    06-09-2010
    Location
    Australia
    MS-Off Ver
    Excel 2013
    Posts
    1,714

    Re: Concatenate that remove empty cells

    try
    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,413

    Re: Concatenate that remove empty cells

    Try:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Concatenate that remove empty cells

    In A2 and drag down

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


    In B2 and drag down

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


    in C2 and drag down

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


    More than one way to skin this cat though so you may get a more dynamic or elegant solution elsewhere but this does the job
    Please do add reputation where you see fit, it's nice to be nice and we all enjoy a pat on the back

    Please also mark your thread as solved once it has been.

  5. #5
    Valued Forum Contributor PFDave's Avatar
    Join Date
    05-17-2012
    Location
    Milton Keynes, England
    MS-Off Ver
    Excel 2013
    Posts
    1,067

    Re: Concatenate that remove empty cells

    D'oh, I've done the reverse! TMS has nailed this one

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,413

    Re: Concatenate that remove empty cells

    Mmm. Might end up with an extra slash on the end. You can remove that easily enough.

  7. #7
    Registered User
    Join Date
    05-18-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    26

    Re: Concatenate that remove empty cells

    Quote Originally Posted by TMS View Post
    Mmm. Might end up with an extra slash on the end. You can remove that easily enough.
    that's my main problem, what if i have thousands list, how do i delete all "/" in the end. sorry for trouble.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,413

    Re: Concatenate that remove empty cells

    There would only be 1 extra slash at the end. Your data doesn't show thousands, it shows 3. The formula is not scalable to thousands. For that, you would need a VBA UDF.

  9. #9
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,907

    Re: Concatenate that remove empty cells

    One way ...

    =MID(IF(A1="","","/"&A1)&IF(B1="","","/"&B1)&IF(C1="","","/"&C1)&IF(D1="","","/"&D1),2,10000)

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Concatenate that remove empty cells

    TMS: i think OP means thousand of rows not thousands of columns

    in which case
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  11. #11
    Registered User
    Join Date
    05-18-2017
    Location
    PHILIPPINES
    MS-Off Ver
    2010
    Posts
    26

    Re: Concatenate that remove empty cells

    Quote Originally Posted by TMS View Post
    There would only be 1 extra slash at the end. Your data doesn't show thousands, it shows 3. The formula is not scalable to thousands. For that, you would need a VBA UDF.
    sorry i mean rows. but thanks for the time.


    Quote Originally Posted by humdingaling View Post
    TMS: i think OP means thousand of rows not thousands of columns

    in which case
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    this works pretty fine. thank you so much

  12. #12
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,413

    Re: Concatenate that remove empty cells

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  13. #13
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,413

    Re: Concatenate that remove empty cells

    Thanks for the rep.

+ 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. [SOLVED] Concatenate and remove zeros from blank cells
    By JO505 in forum Excel General
    Replies: 4
    Last Post: 11-17-2020, 06:31 PM
  2. Replies: 0
    Last Post: 06-30-2015, 06:42 PM
  3. [SOLVED] concatenate without empty cells
    By BROEA in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-11-2015, 08:03 AM
  4. [SOLVED] how to remove empty cells
    By Reside in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-08-2014, 09:39 AM
  5. [SOLVED] Need to concatenate cells and remove duplicates
    By jdcooper88 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-23-2014, 03:54 PM
  6. Macro to concatenate cells in a range that skips empty columns
    By _lm in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2011, 03:53 PM
  7. Remove empty cells
    By wei82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-25-2007, 10:21 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