+ Reply to Thread
Results 1 to 14 of 14

Merging two list into one using formula and keeping only unique values

  1. #1
    Registered User
    Join Date
    04-26-2014
    Location
    laois, ireland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Merging two list into one using formula and keeping only unique values

    hi,
    i'm looking to merge two lists of names into one combined list with only unique values.
    the two lists have mostly the same info but list 1 contains some info not in list 2 and visa versa.
    i need it so that each list can be updated and the combined list will automatically update itself.

    can this be done??

    Rob

  2. #2
    Registered User
    Join Date
    03-22-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007,2010
    Posts
    39

    Re: Merging two list into one using formula and keeping only unique values

    Hi rbncpr,

    Yes it can be done. Please attach sample worksheet. You can use "&" to combine two names.

    Regards,

  3. #3
    Registered User
    Join Date
    04-26-2014
    Location
    laois, ireland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Merging two list into one using formula and keeping only unique values

    Merge lists.xlsx

    here's an example of what i'm trying to do!

  4. #4
    Registered User
    Join Date
    03-22-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007,2010
    Posts
    39

    Re: Merging two list into one using formula and keeping only unique values

    hi rbncpr,

    This can be done but you will use another column but if you don't prefer using another column.I think VBA code is needed for this.

    What do you prefer?

    Thanks

  5. #5
    Registered User
    Join Date
    04-26-2014
    Location
    laois, ireland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Merging two list into one using formula and keeping only unique values

    i have no problem with using another column, i'd like to avoid VBA if possible and keep it with formulae!

  6. #6
    Registered User
    Join Date
    03-22-2014
    Location
    Philippines
    MS-Off Ver
    Excel 2007,2010
    Posts
    39

    Re: Merging two list into one using formula and keeping only unique values

    Hi rbncpr

    this formula will work on your sample worksheet,but if you will add data,i think you also need to change conditions in the formula.


    on C3, paste this formula =IF(COUNTIF(list1,A2)=1,A2,IF(COUNTIF(list2,B2)=1,B2,"")) on D3,paste this formula,=IF(COUNTIF($C2:$C$15,C2)=1,C2,"")

    you will see your required result in D3

  7. #7
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Merging two list into one using formula and keeping only unique values

    Hi,

    Go to Name Manager and define Rowz as:

    =ROW(INDIRECT("1:"&ROWS(list1)*2))

    Your array formula** is then:

    =IFERROR(INDIRECT(TEXT(SMALL(IF(FREQUENCY(IF($A$2:$B$15<>"",MATCH($A$2:$B$15,T(OFFSET($A$2,INT((Rowz-1)/2),MOD(Rowz-1,2),,)),0)),Rowz),(10^3*(ROW($A$2)+INT((Rowz-1)/2)))+1+MOD(Rowz-1,2)),ROWS($1:1)),"R000C000"),0),"")

    Copy down until you start to get blanks for the results.

    Regards


    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    Click * below if this answer helped

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

  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: Merging two list into one using formula and keeping only unique values

    Use this formula in C2

    =IFERROR(INDEX(list1,MATCH(0,INDEX(COUNTIF($C$1:C1,list1),,),)),IFERROR(INDEX(list2,MATCH(0,INDEX(COUNTIF($C$1:C1,list2),,),)),""))

    A
    B
    C
    1
    List 1 List 2 List 3
    2
    AAB
    AAC
    AAB
    3
    AAC
    AAC
    AAC
    4
    AAD
    AAD
    AAD
    5
    AAD
    AAF
    AAE
    6
    AAD
    CCA
    BBA
    7
    AAE
    CCA
    BBC
    8
    BBA
    BBA
    zaza
    9
    BBA
    BBA
    zzz
    10
    BBA
    BBD
    AAF
    11
    BBA
    BBG
    CCA
    12
    BBC
    poof
    BBD
    13
    BBA
    Pran
    BBG
    14
    zaza
    poof
    15
    zzz
    Pran
    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 Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Merging two list into one using formula and keeping only unique values

    I should've mentioned that I was attempting to design a solution which could be extended (with suitable modifications) to an arbitrary number of columns, not just two.

    If you in fact will only ever have two, then it would make sense to take e.g. AlKey's solution, which is simpler and less resource-heavy.

    Regards

  10. #10
    Registered User
    Join Date
    04-26-2014
    Location
    laois, ireland
    MS-Off Ver
    Excel 2010
    Posts
    6

    Re: Merging two list into one using formula and keeping only unique values

    thanks everyone for yere help... i finally have it working the way i wanted! AlKey's solution is working well, cheers!!

  11. #11
    Forum Contributor
    Join Date
    08-02-2012
    Location
    Pune
    MS-Off Ver
    Office 365 (Win 10)
    Posts
    489

    Re: Merging two list into one using formula and keeping only unique values

    Please close the thread if you got your solution.

    You can have a look at this also in the mean time
    Please make the Post as solved, when you get your answer & Click * if you like my suggestion

  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: Merging two list into one using formula and keeping only unique values

    You're welcome and thank you for the feedback!

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

  13. #13
    Registered User
    Join Date
    05-30-2012
    Location
    UK
    MS-Off Ver
    365
    Posts
    7
    hi all

    Does anyone know how to do the above with the new dynamic array formulas?

  14. #14
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,041

    Re: Merging two list into one using formula and keeping only unique values

    Administrative Note:

    We are happy to help, however whilst you feel your request is similar to this thread, experience has shown that things soon get confusing when answers refer to particular cells/ranges/sheets which are unique to your post and not relevant to the original.

    Please see Forum Rule #4 about hijacking and start a new thread for your query.

    If you are not familiar with how to start a new thread see the FAQ: How to start a new thread
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

+ 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. Combining Values in rows and keeping unique values (adv. filtering?)
    By nguyeda in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-26-2011, 01:48 PM
  2. Merging names that are not unique while keeping their corresponding data
    By fredman in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-12-2009, 03:29 PM
  3. Merging unique ID while keeping their corresponding data
    By johnny1 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-10-2009, 03:46 PM
  4. Replies: 8
    Last Post: 12-30-2008, 12:06 PM
  5. Merging Two Cells and Keeping the Values
    By Raymond in forum Excel General
    Replies: 10
    Last Post: 05-30-2005, 04:05 PM

Tags for this Thread

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