+ Reply to Thread
Results 1 to 6 of 6

Creating a list from two fields of numbers

  1. #1
    Registered User
    Join Date
    08-25-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    72

    Creating a list from two fields of numbers

    Using 2007 here. I've attached a small sample. I've identified that some numbers appear in both lists. What I'd like to do is create a list of those numbers. Also is there a way of creating a list of numbers which do NOT appear in both lists?

    Thanks in advance

    RL.
    Attached Files Attached Files
    Last edited by Redder Lurtz; 01-25-2012 at 10:35 AM.

  2. #2
    Forum Contributor darknation144's Avatar
    Join Date
    01-24-2012
    Location
    London
    MS-Off Ver
    Microsoft Excel 365 MSO
    Posts
    555

    Re: Creating a list from two fields of numbers

    Answered my own question
    Last edited by darknation144; 01-25-2012 at 09:29 AM.

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Creating a list from two fields of numbers

    Change your formula in D2 to:

    =IF(COUNTIF($B$2:$B$30,A2)>0,COUNT(D$1:D1)+1,"")

    copied down

    and in E2:

    =IF(COUNTIF($B$2:$B$30,A2)>0,COUNT($E$1:$E1)+1,"")

    Then in your summary column, say G2:

    =IFERROR(INDEX(A$2:A$30,MATCH(ROWS($A$1:$A1),D$2:D$30,0)),"")

    copied down and to next column.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Registered User
    Join Date
    12-30-2011
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Creating a list from two fields of numbers

    Hi there,

    There's probably a more elegant way of doing this but...

    If you copy both lists into a single column (I used J) and go to Data > Remove duplicates. Then enter in K and copy down:

    =SUM(COUNTIF($A$2:$A$30,J2),COUNTIF($B$2:$B$30,J2))

    Sort to give you the lowest occurences - i.e. the 1's, then delete the 2's..

    See attached. As I say, a bit hacky - but it works!

    HTH,

    Fermented S
    Attached Files Attached Files
    Last edited by Fermented Reptile; 01-25-2012 at 09:35 AM.

  5. #5
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Creating a list from two fields of numbers

    I put the following formula in cell C2:

    =IF(ROW()-1>SUM(--(NOT(ISNA(MATCH(INDEX($A$2:$A$30,0),INDEX($B$2:$B$30,0),0))))),"",INDEX($B$2:$B$30,LARGE(IF(ISNA(MATCH(INDEX($A$2:$A$30,0),INDEX($B$2:$B$30,0),0)),0,MATCH(INDEX($A$2:$A$30,0),INDEX($B$2:$B$30,0),0)),ROW()-1)))

    As it's an array formula it must be entered using Ctrl-Shift-Enter, but can then be copied down to row 30 and will list all of the numbers in column A which also appear in column B.

  6. #6
    Registered User
    Join Date
    08-25-2009
    Location
    Leeds, England
    MS-Off Ver
    Excel 2003
    Posts
    72

    Re: Creating a list from two fields of numbers

    Thanks everyone, some real inspiration here. Thank you.

    RL

+ 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