+ Reply to Thread
Results 1 to 6 of 6

concatenate with specific amount of characters?

  1. #1
    Registered User
    Join Date
    05-31-2012
    Location
    Groenlo, Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    63

    concatenate with specific amount of characters?

    Is there a way to combine functions in excel to create something like: Concatenate(X1,X2,X3,X4) with all X1 to X4 with a (different) defined length?
    So, if X1 only has 3 characters it should still be seen as e.g. 6 characters. (so 3 spaces are added at the end of X1)
    to give an example: concatenate(X1;X2;X3;X4) and length 6;6;8;5
    with X1=123.;X2=123;X3=123;X4=123 should result in:
    123___123___123_____123__ with _ for the spaces

  2. #2
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: concatenate with specific amount of characters?

    Hi there,

    Can you supply somemore data with results? From your post above you have 123 in every cell but want the character lenght to be 6,6,8,5?? HOw do you determine the length of the additonal spaces?
    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  3. #3
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: concatenate with specific amount of characters?

    Hi,

    I hope I'm translating correctly formula

    Just an idea

    Please Login or Register  to view this content.
    I'm using ";" in the formula as in my Pc settings

    Regards
    Last edited by canapone; 10-10-2013 at 10:15 AM.
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

  4. #4
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: concatenate with specific amount of characters?

    Think I under stand what you want, try the following

    =CONCATENATE(REPLACE(X1,LEN(X1)+1,1,REPT(" ",6-LEN(X1))),REPLACE(X2,LEN(X2)+1,1,REPT(" ",6-LEN(X2))),REPLACE(X3,LEN(X3)+1,1,REPT(" ",8-LEN(X3))),REPLACE(X4,LEN(X4)+1,1,REPT(" ",5-LEN(X4))))

  5. #5
    Registered User
    Join Date
    05-31-2012
    Location
    Groenlo, Netherlands
    MS-Off Ver
    Excel 2019
    Posts
    63

    Re: concatenate with specific amount of characters?

    The formula does exactly what I asked for, but the results are not what I hoped for.

    I have two tabs in my excel that I want to combine in one print, both containing up to 3000 rows.

    Tab 1 contains positions (posistionnumber, name, quantity, price etc) and below several rows off calculation.
    Tab 2 contains the same positions with several rows of explanations

    Both tabs have several columns.

    I got the request to have a print made of all the positions with: position, explanation and the calculation, then the next position.

    My idea was to use the formula above so only one column with data would be left per tab, the problem is though that the characters don't have the same size and the print ends in a bit of a mess. Any other idea to make a combined print?

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

    Re: concatenate with specific amount of characters?

    Please attach a sample workbook with enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

    Note: Please don't attach documents containing confidential data like (address, telephone, ID#s, etc.).


    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

+ 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] Macro to concatenate variable amount of columns
    By phil3061 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2013, 02:53 PM
  2. Need to add spaces to end of text to reach a specific amount of characters.
    By keshido in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-23-2013, 08:37 PM
  3. Trim a files name to a specific amount of characters using vba.
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2011, 11:54 AM
  4. Replies: 5
    Last Post: 09-30-2010, 08:02 PM
  5. setting up specific amount of characters
    By youngw in forum Excel General
    Replies: 1
    Last Post: 03-26-2008, 02:00 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