+ Reply to Thread
Results 1 to 4 of 4

Concatenate columns with information base on user selection

  1. #1
    Registered User
    Join Date
    11-23-2012
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    2

    Concatenate columns with information base on user selection

    Hi Everyone,

    I have to concatenate a number of columns with information from another sheet base on what a use enters on the first column

    for e.g sheet 1 has four columns and the fifth column I want to concatenate the information together with information from sheet 2

    =CONCATENATE(IF(A2="SAP";'data 2'!B1&";"&B2&";"&C2&";"&D2);(IF(A2="SAD";'data 2'!B2&";"&B2&";"&C2&";"&D2)))
    Attached Files Attached Files

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2505 Win 11
    Posts
    24,754

    Re: Concatenate columns with information base on user selection

    Try this:

    =if(A2="SAP",Concatenate('data 2'!B1&";"&B2&";"&C2&";"&D2),if(A1="SAD",concatenate('data 2'!B2&";"&B2&";"&C2&";"&D2),Value here if something other than SAP or SAD))


    Check this tutorial and especially the last example. I am not sure about your concatenation sequences. I suspect they need to be tweaked as you did not give us expected results.

    Alan
    Last edited by alansidman; 12-03-2012 at 02:32 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    11-23-2012
    Location
    Trinidad
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Concatenate columns with information base on user selection

    HI Alan,

    Thanks for the code.
    but it seems when I ad another row of data excel tell me that you hve entered toom any arguments for the function

    e.g

    =IF(A2="SAP";CONCATENATE('data 2'!B1&";"&B2&";"&C2&";"&D2);IF(A2="SAP";CONCATENATE('data 2'!B1&";"&B2&";"&C2&";"&D2));IF(A2="SAP";CONCATENATE('data 2'!B1&";"&B2&";"&C2&";"&D2)))
    I did not see the link to the tutorial that you spoke about.

    gward2701

  4. #4
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: Concatenate columns with information base on user selection

    Hi gward2701,

    Watch your parentheses...

    An IF function requires 3 parameters, IF(condition,true,false)

    For nested IF functions, the true or false (or both), can be replaced by another IF statement, which will also need 3 paramenter as above.

    Your formula should look like this... IF(condition1,concat1,IF(condition2,concat2,concat3))

    In your nested IFs, it should read something like this... IF(A2="SAP",concat1,IF(A2="SAD",concat2,concat3))

    In your formula, the 2nd IF statement has a condition, a true statement, but missing a false statement. Watch your parenthesis...

    Hope this helps...

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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