+ Reply to Thread
Results 1 to 17 of 17

Concatenate Unique Values

  1. #1
    Registered User
    Join Date
    01-15-2014
    Location
    Newark, DE
    MS-Off Ver
    Excel 2007
    Posts
    91

    Concatenate Unique Values

    I don't know VBA or macros. I need a formula to take this where each value is in a separate column:
    ZP ZP Z1 Z1 UNASSIGNED

    to this in one cell:
    ZP Z1 UNASSIGNED

    Any help is greatly appreciated.

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Concatenate Unique Values

    The easier way is to use Text To Columns option from Data Tab.
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  3. #3
    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
    53,048

    Re: Concatenate Unique Values

    Is each of those in its own cell?

    Attach a sample workbook. Make sure there is just 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
    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

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Concatenate Unique Values

    I don't think you'll be able to do this with a single practical formula (someone may be able to do it with a monster formula).

    A VBA user defined function is the best option for something like this.

    You don't really need to understand how the VBA code works, just knowing that it does what you want and how to implement it should be a good place to start.

    I can give you step-by-step instructions.

    Interested?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    01-15-2014
    Location
    Newark, DE
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Concatenate Unique Values

    Attached is an example and it's a bit more complex than I initially asked but if I need to repeat the steps by region (NA, EMEA, APAC being the regions), I've no problem doing that. Columns D - I contain values for the APAC region. I need to concatenate only the unique values in those cells into Column A. Same for EMEA I need to concatenate only the unique values from Columns J-V into Column B. Concatenate only the unique values from Columns W-Z into Column C. So Columns D - Z are the before, Columns A-C are the after.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-15-2014
    Location
    Newark, DE
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Concatenate Unique Values

    P.S. If you can tell a total newbie how to enter the code, I'm certainly willing to give it a try. My co-worker I believe did this with a formula but he writes monster formulas regularly.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Concatenate Unique Values

    OK, I'm breaking for lunch and will be away for a few hours.

    When I return I'll take a look at your file and see what we can come up with.

  8. #8
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Concatenate Unique Values

    in E1

    =IF(COUNTIF($A$1:A1,A1)=1,A1,"")&" "&IF(COUNTIF($A$1:B1,B1)=1,B1,"")&" "&IF(COUNTIF($A$1:C1,C1)=1,C1,"")&" "&IF(COUNTIF($A$1:D1,D1)=1,D1,"")&" "&"UNASSIGNED"



    A
    B
    C
    D
    E
    1
    ZP ZP Z1 Z1 ZP Z1 UNASSIGNED
    2
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Concatenate Unique Values

    Please see attached. Columns A, B and C are now filled with formulas.
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    01-15-2014
    Location
    Newark, DE
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Concatenate Unique Values

    AlKey: Thanks!!!!!!!!

  11. #11
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Concatenate Unique Values

    You're welcome and thanks for the feedback!

    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools-> Mark thread as Solved).

  12. #12
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Concatenate Unique Values

    Now, if you want a Vb solution you can use this nice UDF

    Press Alt+F11 to open VBA editor
    Go Insert and select Module
    Paste code below into Module and close editor

    Use formula:

    =TRIM(ConcatUniq(W3:Z3," "))


    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    01-15-2014
    Location
    Newark, DE
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Concatenate Unique Values

    Thanks! After I get this report done I will try the VBA. Thank goodness for all of you patient, generous geniuses here!

  14. #14
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Concatenate Unique Values

    Quote Originally Posted by Tony Valko View Post

    When I return I'll take a look at your file and see what we can come up with.
    Looks like that's not necessary!

  15. #15
    Registered User
    Join Date
    01-15-2014
    Location
    Newark, DE
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Concatenate Unique Values

    Quote Originally Posted by Tony Valko View Post
    Looks like that's not necessary!
    Yep someone beat you to the punch but thank you very much for the offer!

  16. #16
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Concatenate Unique Values

    You're welcome!

    Good luck!

  17. #17
    Registered User
    Join Date
    01-15-2014
    Location
    Newark, DE
    MS-Off Ver
    Excel 2007
    Posts
    91

    Re: Concatenate Unique Values

    Ignore this post as I'm not able to delete it.
    Last edited by shdwfx; 01-21-2014 at 09:42 AM.

+ 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 find duplicates, concatenate Unique Values, then delete old duplicates
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-17-2013, 04:32 PM
  2. Update to Macro to find duplicates, concatenate Unique Values
    By lesoies in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-10-2013, 06:35 PM
  3. Using a concatenate formula to count unique values
    By braydon16 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2011, 03:10 PM
  4. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  5. Concatenate & Unique Values
    By John Bates in forum Excel General
    Replies: 2
    Last Post: 06-25-2009, 03:45 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