+ Reply to Thread
Results 1 to 10 of 10

Advanced Concatenate with spaces separating numbers

  1. #1
    Registered User
    Join Date
    01-13-2009
    Location
    los angeles
    MS-Off Ver
    Excel 2007
    Posts
    6

    Advanced Concatenate with spaces separating numbers

    Hi,

    I am using concatenate and it looks something like this. =CONCATENATE(C6,B6,B7,B8,B9), then I go in and add " ", to add spaces between each number so it looks like this =CONCATENATE(C6," ",B6," ",B7," ",B8," ",B9).
    Sometimes there are 100 or more cells I am selecting, I would like to use shift, but then it looks like this =CONCATENATE(B4:B127), how do I add spaces to a range?

    my problem is very similar to the question asked in this thread http://www.excelforum.com/excel-work...ncatenate.html
    but I am using numbers and would like to separate them with spaces.

    Thanks!
    Last edited by naynay; 01-14-2009 at 12:51 AM. Reason: to add solved to the title.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284
    Try this UDF

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    01-13-2009
    Location
    los angeles
    MS-Off Ver
    Excel 2007
    Posts
    6
    Hi Bob,

    Thank you so much for your help. I am a newbie when it comes to functions. Where do I put that code? I am using Excel 2007.

    Thanks again.

  4. #4
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320
    download and install more functions add in
    http://www.download.com/Morefunc/300...-10423159.html
    then use mconcat however this seems limited to about 88 cells but you can get around that by
    =MCONCAT(A1:A65," ")&" "&MCONCAT(A65:A130," ")

  5. #5
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    Using MCONCAT the output string is limited to 256 characters due I believe to limitations imposed by the C API used to shovel information back and forth between the xll functions and Excel.

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  6. #6
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284
    Quote Originally Posted by naynay View Post
    Hi Bob,

    Thank you so much for your help. I am a newbie when it comes to functions. Where do I put that code? I am using Excel 2007.

    Thanks again.
    Go to the VBIDE, Alt-F11, and insert a code module Insert>Module, and paste the code in. Close the VBIDE and in Excel, use

    =CONCAT(C6,B6,B7,B8,B9)

  7. #7
    Registered User
    Join Date
    01-13-2009
    Location
    los angeles
    MS-Off Ver
    Excel 2007
    Posts
    6
    Bob,

    Thank you so much, it worked like a charm.

  8. #8
    Registered User
    Join Date
    10-24-2010
    Location
    india
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Advanced Concatenate with spaces separating numbers

    sorry i could not use it.......

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Advanced Concatenate with spaces separating numbers

    could not use what? please start your own thread ,linking to this one if you want,with a proper title
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  10. #10
    Registered User
    Join Date
    06-22-2014
    Location
    Brighton, England
    MS-Off Ver
    2010
    Posts
    1

    Re: Advanced Concatenate with spaces separating numbers

    Hi, I had a similar problem and this solution worked a charm too, thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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