+ Reply to Thread
Results 1 to 7 of 7

Compare two collums with nine numbers.

Hybrid View

  1. #1
    Registered User
    Join Date
    02-20-2013
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    70

    Talking Compare two collums with nine numbers.

    fellow members I have a slight problem with a comparison of two collum's.
    collum A and B have 9 numbers (in a cell) and about 40.000 rows in A and about 34.000 in B.

    Now a have to compare those collums and those numers.
    Do all the numbers in A also stand in B?
    The numbers that are not in B have to go to an new sheet named "Rest".

    I have never don such a search can you help me?

    Privacy rules forbid me to make the workbook public.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Compare two collums with nine numbers.

    Privacy rules forbid me to make the workbook public
    Then post an anonymised sample, it will help to clarify what you mean by "9 numbers (in a cell)". For example - 123456789...? 1,4,2,6,45,76,89,12,34 ...??

  3. #3
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Compare two collums with nine numbers.

    You can do that with the help of a helper column easily. See the attachment. Here Column C of Sheet named "Numbers" is helper column. In the cell C2 I have used this formula to find that which number of column A doesn't lie in column B and copy down :
    Formula: copy to clipboard
    =IF(COUNTIF($B$2:$B$9,$A2)>0,"",ROW())

    Then I have used below formula in the cell A2 of Sheet named "Rest" to draw those numbers from the sheet named "Numbers" and copy down :
    Formula: copy to clipboard
    =IFERROR(INDEX(Numbers!$A$2:$A$9,SMALL(Numbers!$C$2:$C$9,COUNTA($A$1:$A1))-1),"")

    Hope that will help.
    Attached Files Attached Files
    Last edited by sanram; 04-11-2017 at 06:18 AM. Reason: Wrong formula and Attachment

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Compare two collums with nine numbers.

    Does this help?

    Sub blake20()
    Dim i As Long, x As Worksheet, y, z As Range
    Set x = Sheets("Rest")
    ReDim y(2 To Range("A" & Rows.Count).End(3).row)
    For i = LBound(y) To UBound(y)
        Set z = Columns(2).Find(Cells(i, "A"), LookIn:=xlValues, Lookat:=xlWhole)
            If z Is Nothing Then
                Cells(i, "A").Copy x.Cells(Rows.Count, "A").End(3)(2)
            End If
        Set z = Nothing
    Next i
    End Sub

  5. #5
    Registered User
    Join Date
    02-20-2013
    Location
    Amsterdam, Netherlands
    MS-Off Ver
    Excel 2010
    Posts
    70

    Re: Compare two collums with nine numbers.

    Sorry for the late reaction but i have been sick.
    Everybody thanks for their reactions.
    Especialy John H Davis. It worked like a charm.

    thx.

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Compare two collums with nine numbers.

    You're welcome. Glad to help out and thanks for the feedback. Please mark this thread as SOLVED.

  7. #7
    Valued Forum Contributor
    Join Date
    06-21-2013
    Location
    Bangladesh
    MS-Off Ver
    Excel 2000, Excel XP, Excel 2002, Excel 2007, Excel 2010, Excel 2013
    Posts
    975

    Re: Compare two collums with nine numbers.

    Glad to hear that you have found the solution.

+ 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. [SOLVED] Compare two cells with comma delimited numbers and display the numbers that are NOT duplic
    By ks100 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-13-2014, 02:22 PM
  2. Compare 3 Collums and delete duplicate
    By nackgr in forum Excel General
    Replies: 12
    Last Post: 01-04-2011, 08:27 AM
  3. Date formatting for collums
    By Bigyaw in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-01-2008, 03:02 PM
  4. Sum of current row from selected collums
    By FabianN in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-03-2008, 02:54 AM
  5. Compare/Sum different Collums
    By Jimbras in forum Excel General
    Replies: 2
    Last Post: 09-12-2007, 12:11 PM
  6. VLOOKUP should compare numbers stored as text to plain numbers.
    By VLOOKUP - Numbers stored as text in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 03-31-2006, 12:55 PM
  7. [SOLVED] matches in two collums of numbers?
    By kdbeal in forum Excel General
    Replies: 1
    Last Post: 11-07-2005, 11:25 PM

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