+ Reply to Thread
Results 1 to 18 of 18

Shorten my CONCATENATE formula

  1. #1
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Shorten my CONCATENATE formula

    I have the following:

    =CONCATENATE(B3,C3,D3,E3,F3,g3,h3,i3,j3,k3,l3,m3,n3,o3,p3,q3,r3,s3,t3,u3,v3,w3,x3,y3,z3,aa3,ab3,ac3,ad3,ae3,af3,ag3,ah3,ai3,aj3,ak3,al3,am3,an3,ao3,ap3,aq3,ar3,as3,at3)

    is there any way to shorten it?
    Last edited by lordfa9; 12-31-2014 at 12:40 AM.

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,141

    Re: Shorten my CONCATENATE formula

    There will be VBA ways to do this properly. This sort-of achieves the same result. But it's not very useful (as you'll see).


    Select any empty cell.
    Type =concatenate(TRANSPOSE(b3:at3))
    Witht hte mose, select the TRANSPOSE(H3:AT3) portion.
    Press F9.
    Delete curly brackets in formula bar.
    Press Enter
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Re: Shorten my CONCATENATE formula

    you mean the curly brackets at the start and end of the resulting long string of text right? Did that and while I could see a lot of stuff in the formula bar, the actual cell was empty

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,141

    Re: Shorten my CONCATENATE formula

    Yes. when you hit F9, was the "stuff" separated by commas or semicolons?

  5. #5
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Re: Shorten my CONCATENATE formula

    yup. The stuff also appeared to be the right answer (for that particular line) but it didn't appear in the spreadsheet itself

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,141

    Re: Shorten my CONCATENATE formula

    Which... commas or semicolons?

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: Shorten my CONCATENATE formula

    Perhaps you could do a copy/paste special values on the cell containing the formula Glenn suggested.
    If posting code please use code tags, see here.

  8. #8
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Cool Re: Shorten my CONCATENATE formula

    If your are on for VBA code.
    IT WILL HANDLE EMPTY CELLS AS WELL
    Syntax:- JoinC(Range OR Array, Dilimiter as String)

    Here is the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Here are the Codes:-
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Check the attached file
    Attached Files Attached Files
    Last edited by Vikas_Gautam; 12-26-2014 at 06:15 AM.
    Regards,
    Vikas Gautam
    Excel-buzz.blogspot.com

    Excel is not a matter of Experience, its a matter of Application.

    Say Thanks, Click * Add Reputation

  9. #9
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Re: Shorten my CONCATENATE formula

    it became:

    ={"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"EXCELFORUM";"";"";"";"";"";"";"";"";"";"";"";"EXCELFORUM,";"";"";"EXCELFORUM,";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""}

    when I removed the curly brackets highlighted above in red, excel refused to accept the output
    Last edited by lordfa9; 12-24-2014 at 04:06 AM.

  10. #10
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Re: Shorten my CONCATENATE formula

    Quote Originally Posted by Norie View Post
    Perhaps you could do a copy/paste special values on the cell containing the formula Glenn suggested.
    didn't work, cell really became blank

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,141

    Re: Shorten my CONCATENATE formula

    Here are a few options that you may not have seen:
    http://www.get-digital-help.com/2011...-vba-in-excel/
    http://www.cpearson.com/excel/stringconcatenation.aspx
    http://excel.tips.net/T003062_Concat..._of_Cells.html

    there is always a "brute force & ignorance" approach...
    Attached Files Attached Files

  12. #12
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Shorten my CONCATENATE formula

    A correction to the Glenn's technique.
    Try this.

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


    Type above formula and Select the red portion..
    Press F9 and Remove the"{}" braces
    Press enter.
    It will work definitely.

  13. #13
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,141

    Re: Shorten my CONCATENATE formula

    Vikas, it does work.... at least on my PC. I suspect that regional settings were messing up my previous efforts...

  14. #14
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Re: Shorten my CONCATENATE formula

    Quote Originally Posted by Vikas_Gautam View Post
    A correction to the Glenn's technique.
    Try this.

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


    Type above formula and Select the red portion..
    Press F9 and Remove the"{}" braces
    Press enter.
    It will work definitely.
    It works but now it literally pastes the following into my cell:

    "";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"EXCELFORUM";"";"";"";"";"";"";"";"";"";"";"";"EXCELFORUM,";"";"";"EXCELFORUM,";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";"";""

    Now I have to manually remove the quotation marks and semicolons, also I have to do your steps for every single row -_-

  15. #15
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Shorten my CONCATENATE formula

    Quote Originally Posted by Glenn Kennedy View Post
    Witht hte mose, select the TRANSPOSE(H3:AT3) portion.Press F9.
    Till now not aware of this evaluation part inside the formula using F9. Learned a new thing today and thanks for that


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  16. #16
    Forum Expert Vikas_Gautam's Avatar
    Join Date
    06-04-2013
    Location
    Ludhiana,Punjab, India
    MS-Off Ver
    Excel 2013
    Posts
    1,850

    Re: Shorten my CONCATENATE formula

    Now I have to manually remove the quotation marks and semicolons, also I have to do your steps for every single row -_-
    Thats why I suggest you to use the UDF in Post #8, as its much more simpler and faster..

  17. #17
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Re: Shorten my CONCATENATE formula

    Quote Originally Posted by Glenn Kennedy View Post
    Here are a few options that you may not have seen:
    http://www.get-digital-help.com/2011...-vba-in-excel/
    http://www.cpearson.com/excel/stringconcatenation.aspx
    http://excel.tips.net/T003062_Concat..._of_Cells.html

    there is always a "brute force & ignorance" approach...
    none of the links were really helpful (the VBA made my head spin lol) but I'll just stick to using the old CTRL+Lclick method (if there aren't too many (<20) columns or the method you showed me in the excel file if there are a LOT of them

  18. #18
    Forum Contributor
    Join Date
    05-07-2007
    Location
    Singapore
    MS-Off Ver
    2006/2016
    Posts
    170

    Re: Shorten my CONCATENATE formula

    Came up with a workaround

    1) Determine which cells to concatenate (in this example A2:Y2)
    2) Copy paste this formula into a cell cell in the same column as the starting cell; in this case the starting cell is Cell A2 so I inserted a row and put the formula into cell A1
    =CONCATENATE(LEFT(ADDRESS(1,COLUMN(),2),1+(COLUMN()>26)),2,",")
    3) Drag the formula across, so Cell A1 will have A2, Cell B1 will have B2 and so on
    4) Type =Transpose(A1:Y1) into any blank cell
    5) Without pressing enter, Select the range (in this case A1:Y1), it should turn blue, then press F9
    6) Carefully copy anything in between the resulting curly brackets, it should look something like this:
    A2;"B2,";"C2,";"D2,";"E2,";"F2,";"G2,";"H2,";"I2,";"J2,";"K2,";"L2,";"M2,";"N2,";"O2,";"P2,";"Q2,";"R2,";"S2,";"T2,";"U2,";"V2,";"W2,";"X2,";"Y2,"
    7) Paste it somewhere else and use the find and replace function to remove the semi colons and open inverted commas
    8) Use the output for your concatenate formula

    it is in no way time saving, but it is likely human error free and works the best when there are A LOT of cells to concatenate

+ 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. way to shorten this formula?
    By tsiguy96 in forum Excel General
    Replies: 2
    Last Post: 04-03-2012, 08:28 PM
  2. can shorten this formula?
    By mingali in forum Excel General
    Replies: 4
    Last Post: 08-12-2009, 10:22 AM
  3. formula to shorten if need be
    By excellentexcel in forum Excel General
    Replies: 3
    Last Post: 03-04-2009, 01:50 PM
  4. shorten if and formula
    By Michael Wise in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2008, 04:46 PM
  5. [SOLVED] Shorten a Formula
    By Kevin in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-29-2006, 10:35 PM

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