+ Reply to Thread
Results 1 to 24 of 24

Extract a unique list from 2 columns

  1. #1
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Extract a unique list from 2 columns

    Hello.

    I have 2 columns - one with years 1965 through 2017 and the other with numbers 0 through 15.

    I want to make a new list (extract) of years with values greater than 0 (ignore 0) and show the values.

    Example:

    Col 1 Col 2
    1965 2
    1966 0
    1967 1
    1968 3
    1969 0
    1970 4

    New List

    Col 1 Col 2
    1965 2
    1967 1
    1968 3
    1970 4

    Thank you for any help.

    Robert

  2. #2
    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: Extract a unique list from 2 columns

    Enter array formula in D2, drag formula across to E2 and down

    ***Array formula
    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.
    You will know the array is active when you see curly braces { } appear around your formula.
    If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.

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

    v A B C D E F
    1
    2 1965 2 1965 2
    3 1966 0 1967 1
    4 1967 1 1968 3
    5 1968 3 1970 4
    6 1969 0
    7 1970 4
    8
    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

  3. #3
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Extract a unique list from 2 columns

    See attached sample. Formula in column D is array. You need to enter it with ctrl+shft+ent.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    Thank you for the quick reply.

    I tried the formula you wrote changing the cell numbers to my sheet. The years are K4:K56 and values are L4:L56. I copied the formula into cell N3. My re-write is:

    =IFERROR(INDEX(K$4:K$56,MATCH(0,IF($L$4:$L$56>0,COUNTIF($N$3:$N3,$K$4:$K$56)),0)),"")

    When I Ctrl + Shift + Enter I get an error message saying there is a circular reference and it reports a single 0.

    Not sure what I am doing wrong.

    Thanks

  5. #5
    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: Extract a unique list from 2 columns

    You can't enter formula in N3 and have COUNTIF part also start with N3. You have to change to COUNTIF($N$2:$N2,$K$4:$K$56)

  6. #6
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    Ok. Tried that and now it returns only 1967 in cell N3.

    Sorry to be so ignorant of this formula.

  7. #7
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    Thanks.
    I am going to abandon this effort.
    I appreciate your help.

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    God, but you give up easily....
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  9. #9
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    No, I did not give up. I realized that the numbers in the column next to the years each are a formula that gets the number from another cell. I thought this might because your formula to not work. The formula changes for each cell but the first one is =COUNTIF(H4:H190,K4) then =COUNTIF(H4:H190,K5) and so on. I thought this might make your formula not work.

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    ... so is it working for you, or not???

  11. #11
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    No, it is not. I have been trying to attach my file to this but even that is confusing. I click on the attachment icon and it brings up a little screen that is about 1/8 inch high by 2 inches. So I went to Manage Attachments and chose my file but I do not see that it is attached. I don't use this forum very often and some things are unclear or not obvious.

    Now I think I have attached it.

    Thanks for sticking with me.

    Bob

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    I'm out for the night with the Big Boss. Back in UK morning.

  13. #13
    Forum Expert
    Join Date
    11-27-2007
    Location
    New Jersey, USA
    MS-Off Ver
    2013
    Posts
    1,669

    Re: Extract a unique list from 2 columns

    see the attached. formulas are entered in N4:O56.
    you can update your data in K4:L56.
    Attached Files Attached Files

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    It is soooo much easier when you post an excel sheet.

  15. #15
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    WOW Glenn. Your second idea without columns K and L is absolutely perfect, right on. That was what I originally wanted but had zero idea how to start and I didn't even know how to ask for that. This is great. I am very happy. You are the Master.

  16. #16
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    OK, now Glenn. This does what I want but now there are only entries for H4:H22. I expect that we will have entries for H4:H191 within the next 3 weeks. We add names daily. So can I change your equation now to H4:H191 and will it only list and count rows with information? Or do I need to change the range to include only those cells with data?

  17. #17
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    You can. But that's a pain. What you need are dynamic named ranges. look back in 5 minutes.

  18. #18
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    OK. Sorry to throw you a curve.

  19. #19
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    I created a new named range (CTRL-F3) to make the formulae dynamic (up to 10000 rows) and changed the formulae in K1 and L1 to get rid of the slightly redundant totals waaayyy off screen. Not needed.

    It's all about sensible layout.
    Attached Files Attached Files

  20. #20
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    I've been round a lot of Central America (Chile, Argentina, Mexico, Ecuador, Brazil). Just love Chile & Brazil. Back in Santiago in October for a week, I hope, for work and some Peruvian Pisco sours... How is Peru for an ageing wannabe hippy-tourist (own teeth, own hair, but nothing much else works anymore)?

  21. #21
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    Hey that really does the trick. Exactly what I need.

    I moved to Lima, Peru 7 years ago and married a Peruvian woman. I am semi-retired and this is a great place to live. My Social Security income goes far here. Exchange rate is S/.3.20 (3.20 Soles) so my SS is about S/.5,000 a month. Food is cheaper here, rent is cheaper, clothing is cheaper. People are not so stressed or as we used to say, uptight here. Cars and gas are expensive.

  22. #22
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    Worth a trip for a looksee....

  23. #23
    Registered User
    Join Date
    09-18-2016
    Location
    Lima, Peru
    MS-Off Ver
    2013
    Posts
    71

    Re: Extract a unique list from 2 columns

    Come for a visit. I'll show you around or we can talk. Not sure if I am allowed to post private email and US phone number here.

  24. #24
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Extract a unique list from 2 columns

    Don't unless you LOVE spam. better to PM.

+ 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. Replies: 5
    Last Post: 09-04-2016, 07:09 AM
  2. Replies: 6
    Last Post: 07-04-2016, 04:52 PM
  3. Replies: 0
    Last Post: 06-03-2015, 01:33 PM
  4. Extract unique list from column
    By lamdl in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-25-2014, 05:17 AM
  5. [SOLVED] How to extract unique data from two columns
    By Xiaojiang in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-22-2013, 08:07 AM
  6. Extract unique numbers from a list
    By excelbee in forum Excel General
    Replies: 7
    Last Post: 08-11-2012, 09:00 AM
  7. Extract Data From a list with unique value
    By sunflowers in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 12-22-2011, 08:47 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