+ Reply to Thread
Results 1 to 18 of 18

extract unique values in an array

  1. #1
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    extract unique values in an array

    I have 13,000 rows of customer records. I have matched the data to another source and have appended email address. I now have 7 columns containing email addresses (based on various different match keys). A customer could have more than one email address.

    I want to extract the unique emails in each row. So, if Customer ABC in row 1 has 7 email addresses listed in Column B : Column H and only 3 are unique, I want to be able to move those 3 addresses into Column I, Column J, Column K.

    Does anyone have a suggestion on a formula that could do this?

    thanks

  2. #2
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: extract unique values in an array

    how 'bout this:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    (array formula, hold ctrl and shift after you type it in and those {}'s should appear automatically)

    if that doesn't work please upload a sample of your workbook.
    Hope I could help - if your post has been solved don't forget to mark it as such.

    Clicking the * below is a great way to say thanks!

    "Drowning in 10 feet of water isn?t any different than drowning in a million feet. And if you can swim, it doesn?t matter how deep the ocean is. At some level, once you realize you?re in water that?s too deep to stand, you have to have a very different approach," - Joi Ito

  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: extract unique values in an array

    Perhaps consider trying to eliminate the duplicate as you pull them in from the other source?
    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
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    Hi, thank you. it looks right and I'm sure I'm doing something wrong. Please see attached sheet of sample data.

    email array uniques.xlsx

    Hope you can help

  5. #5
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: extract unique values in an array

    sorry, that formula needs to go in J1 and then drag. right now it's a circular reference. you can also throw an iferror() and an if(=0) on there to get rid of N/A's and 0's...

    Formula: copy to clipboard
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    That's it. It's perfect. Thank you enormously. Have been fiddling around with this for hours. Will mark as solved and add reputation.

  7. #7
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    Hey Simarui, it's not quite solved for me. How can I amend the formula so that it ignores blank cells (e.g. b1 contains data, c1 doesn't, d1 contains data). Currently, the formula will not proceed beyond the blank. Hope you can help!

  8. #8
    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: extract unique values in an array

    did you see post #3?

  9. #9
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    Thanks FDibbins. Not sure if it will work for me as some records can appear in multiple rows.

  10. #10
    Valued Forum Contributor
    Join Date
    01-10-2012
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    651

    Re: extract unique values in an array

    hmmmmm that's a problem... if you get rid of my if(=0) piece then it will simply return a 0 for those blank cells...

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    or if you put ="" in the blank cells it will skip them. that might seem like a pain but it's not actually that bad... type ="" into any cell, copy it (ctrl+c), press ctrl+G, click special, blanks and then paste (ctrl+v) should do it...

    oooorrr another option is to put a 0 in column I. you can then hide that column or make the text white or something to disguise it...

    any of those strike your fancy?

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

    Re: extract unique values in an array

    Hi.

    Would you be able to post a workbook with a very small dataset together with your expected results?

    Regards
    Click * below if this answer helped

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

  12. #12
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    One of those is bound to work! I think filling the blanks is the best solution - I'm going to have a play now.

    Thanks enormously for your help.

  13. #13
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    email array uniques v2.xlsx

    Sample data attached. Simarui's formula works but when a cell is blank it stops. Any suggestions before I get into a more manual fix ;-)

    thanks

  14. #14
    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: extract unique values in an array

    Where does this data come from? what is the formula that pulls it in?

  15. #15
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    I'm combining a customer list and a 3rd party source. I'm matching data using multiple look ups - i.e. in column B my match is where the City and Address Line 1 match to City and Address Line 1 in the 3rd party source; in Column C I'm using matching phone numbers. Different matches result in different email addresses coming in. The data is in a poor condition unfortunately. Do you know how to skip blank cells when using an array formula - if I can add that to Simarui's formula I'm in business!

  16. #16
    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: extract unique values in an array

    Im actually thinking that maybe we can modify your lookups so they dont pull in duplicates in the 1st place

    Can you upload a small sample file of what you have/are doing?

  17. #17
    Forum Expert
    Join Date
    12-09-2014
    Location
    Trakai, Lithuania
    MS-Off Ver
    2016
    Posts
    1,416

    Re: extract unique values in an array

    And if you try that.
    Attached Files Attached Files

  18. #18
    Registered User
    Join Date
    03-19-2009
    Location
    UK
    MS-Off Ver
    Excel 2007
    Posts
    41

    Re: extract unique values in an array

    Works a treat. Thanks. I'm so appreciative of all the help received.

+ 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. Extract Unique Values from VBA array
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 10-16-2013, 08:25 PM
  2. [SOLVED] Array formula to extract and sort unique values from two worksheets
    By rshukla in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2013, 06:11 AM
  3. Extract unique values and their count from a two dimensional Array
    By shahirslmn in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-17-2012, 09:37 PM
  4. Replies: 3
    Last Post: 11-24-2011, 06:11 AM
  5. Extract Unique Values from an Array based on Criteria
    By ronleex324 in forum Excel General
    Replies: 1
    Last Post: 10-04-2011, 06:37 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