+ Reply to Thread
Results 1 to 3 of 3

Comparison list

Hybrid View

  1. #1
    Registered User
    Join Date
    04-19-2009
    Location
    London, England
    MS-Off Ver
    Excel 2007
    Posts
    50

    Comparison list

    Hi

    Hopefully someone can answer this (seemingly simple) query

    If I have 2 lists, for example

    1 1
    2 3
    3 4
    4 5
    7 6
    8 7
    9 10

    How would I output a 3rd list (or pair of lists) that showed the differences and matches, for example 1 list like

    1
    3
    4
    7

    To show they both have those values or 2 lists like this

    1 1
    2 -
    3 3
    4 4
    - 5
    - 6
    7 7
    8 -
    9 -
    - 10

    Thanks

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

    Re: Comparison list

    Say your range is in A2:B8, then in C2:

    =IF(COUNTIF($B$2:$B$8,A2)>0,COUNT(C$1:C1)+1,"")

    copied down

    in a new column:

    =IF(ROWS($A$1:$A1)>MAX($C$2:$C$8),"",INDEX($A$2:$A$8,MATCH(ROWS($A$1:$A1),$C$2:$C$8,0)))

    copied down as far as you need.

    Note: If you have a large database, store =MAX($C$2:$C$8) adjusted, in a single cell, and then replace that reference in the formula above so that it doesn't do that calculation over and over...
    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.

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Comparison list

    This might be of some help

    It gives the result in three columns

    1/. Match A&B
    2/. In A & not B
    3/. In B & Not A

    Cheers
    Attached Files Attached Files

+ 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