+ Reply to Thread
Results 1 to 11 of 11

Help to get concatenate output as per requirement

  1. #1
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Help to get concatenate output as per requirement

    Hi friends,

    I want to concatenate columns 'S:W' in the following order
    City, Block, District, State, Country

    I have to use drop down list for Country to City. These are correlated to each other using indirect function. So I want Country to city direction. in my original workbook.
    I'm not getting correct output. I have shown the required output in column 'Y'. The macro is in workbook.

    Any help will be highly appreciated.

    Thanking you in anticipation.
    Attached Files Attached Files
    Sincerely,

    mso3

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Help to get concatenate output as per requirement

    This will give you the return in the order you want...
    =W6&", "&V6&", "&U6&", "&T6&", "&S6

    However you have some extra text in there. If these are constants, then maybe this...
    =W6&", Bl."&V6&", Dis. "&U6&", "&T6&", "&S6

    Insert the line break as needed
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Help to get concatenate output as per requirement

    Thank you. So how to fix it in the following code to get require output.
    Please Login or Register  to view this content.

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

    Re: Help to get concatenate output as per requirement

    This is how I read your problem.
    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Help to get concatenate output as per requirement

    Hi Jindon,
    Thank you. It's very close to perfect. If there is no data available for Country to City then I enter a dash sign which should be replace to "" as shown in the code in post3. Just add a code to replace dash sign to "" then it will be perfect.

    Thank you.

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

    Re: Help to get concatenate output as per requirement

    Post a workbook with sample data, your code is confusing.

    Your desired results contains line feed in 2 places, so I must see the result for the row(s) with "-" cells.
    So need to see many possible different examples and the result for them.

  7. #7
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Help to get concatenate output as per requirement

    Hi Jindon,

    Please see the attached workbook with sample require output shown in column 'Y'.

    Thank you.
    Last edited by mso3; 11-04-2016 at 12:24 PM.

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

    Re: Help to get concatenate output as per requirement

    See if this is how you wanted.
    Please Login or Register  to view this content.

  9. #9
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Help to get concatenate output as per requirement

    Hi Jindon,

    Still there is a little problem. The row 7 and 8 are incorrect. There is a blank line if there is a dash sign. In row 7 the prefix 'Dis.' is not necessary because there is no district and so I enter a dash sign. If there is a dash sign in city and block then I don't want a blank line at the top.

    HTH.
    Last edited by mso3; 11-04-2016 at 12:26 PM.

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

    Re: Help to get concatenate output as per requirement

    Try this one.
    Please Login or Register  to view this content.

  11. #11
    Forum Contributor
    Join Date
    06-29-2014
    Location
    India
    MS-Off Ver
    2010 Windows 10 64 bits
    Posts
    1,269

    Re: Help to get concatenate output as per requirement

    Hi Jindon,
    Excellent! Now it's working fine.

    I appreciate you for the same.

    Have a nice day.

+ 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. Compare values and output cell titles, able to output multiple results
    By TMG2016 in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 05-07-2016, 11:42 AM
  2. [SOLVED] Array to embed formula and if number of output is met output Blank
    By ywang in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-29-2015, 02:34 AM
  3. Display excel output concatenate to calulate percent
    By sarat47 in forum Excel General
    Replies: 4
    Last Post: 11-19-2015, 04:38 AM
  4. [SOLVED] Cell reference, output dates to numeric. Should output as text
    By lifeseeker1019 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2015, 05:51 PM
  5. Using vlookup with concatenate output data
    By dianamay in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-19-2011, 06:04 AM
  6. Looping through columns to copy output into other sheet, and saving output
    By eludlow in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-08-2009, 06:27 AM
  7. if until requirement met
    By stefan via OfficeKB.com in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-28-2005, 03:05 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