+ Reply to Thread
Results 1 to 11 of 11

Trying to cross check Column A with Column B

  1. #1
    Registered User
    Join Date
    01-02-2013
    Location
    San Jose, CA
    MS-Off Ver
    Excel 2007
    Posts
    1

    Trying to cross check Column A with Column B

    Hi Everyone, first post here so please take it easy on me. I have tried to search for an answer to my problem but have not had much success. Perhaps I would be able to receive some help here

    I currently have a set of numbers in Col A. Each cell in Col A is a unique entry (ie. A1=12345, A2=23584) I need to cross check Col B against Col A to make sure that all of the entries in Col B have a match with Col A. However Col B is not in the same order as Col A (ie. A1=12345, B1=54325, B8=12345) I would like to have Col B checked against A and display all missing unique ID's in Col C. Is this possible?

    Essentially Col A is my shipping manifest, Col B is my customers receiving manifest and we want to make sure ea individual item was receieved

    Any help towards this would be greatly appreciated!

    Cheers!

    Edit: Forgot to add the sample of my spreadsheet
    Last edited by wliu81; 01-02-2013 at 09:37 PM.

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Trying to cross check Column A with Column B

    hi wliu81, welcome to the forum. please change the formatting of column C to be "General" first. formulas will not be able to be presented in Text format. so currently, everything in column B can be found in column A right? you will get blank for this array formula in C2:
    Please Login or Register  to view this content.
    you have to paste the formula inside the formula bar & press CTRL + SHIFT + ENTER

    but if you change some data in Column A, then you will get the missing numbers.

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    25,421

    Re: Trying to cross check Column A with Column B

    Ensure that both C2 and D2 are formatted as General, then put this formula in C2:

    =IF(COUNTIF(A:A,B2)>0,"",MAX(C$1:C1)+1)

    and copy down to the bottom of your data. Put this formula in D2:

    =IFERROR(INDEX(B:B,MATCH(ROWS($1:1),C:C,0)),"")

    then copy down.

    In your example data there were no numbers that did not have a match, but if you delete the contents of A21 and A22 you will get the results that you showed.

    Hope this helps.

    Pete

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,551

    Re: Trying to cross check Column A with Column B

    I think this will work. But Im not a formula guy.

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

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to cross check Column A with Column B

    In your sample file there are no missing items! Every item in column B has a match in column A.

    I think this is what you want...

    This array formula** entered in C2 and copied down until you get blanks:

    =IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$22,A$2:A$22,0)),ROW(B$2:B$22)),ROWS(C$2:C2))),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Expert Moo the Dog's Avatar
    Join Date
    09-28-2012
    Location
    Wisconsin
    MS-Off Ver
    Office 365 (PC & Mac)
    Posts
    1,845

    Re: Trying to cross check Column A with Column B

    This should check if the value in B2 exists in column A, as well as any of the cells above it in column C so it doesn't duplicate a result... Enter it in cell B2 and fill down:

    (Regular formula.. not array)

    =IF(OR(COUNTIF(A$2:$A$22,B2)>0,COUNTIF($C$1:C1,B2)>0),"",B2)

    - Moo

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to cross check Column A with Column B

    Quote Originally Posted by benishiryo View Post
    Please Login or Register  to view this content.
    Tip...

    Whenever you're trapping errors, you only need to trap the error where it will occur.

    In the above formula if an error is generated it will come from the SMALL function so you only need to trap the error at that point:

    =IF(ISERR(SMALL(IF(ISNA(MATCH($B$2:$B$22,$A$2:$A$22,0)),ROW($B$2:$B$22)-ROW($C$2)+1),ROWS($C$2:C2))),"",INDEX($B$2:$B$22,SMALL(IF(ISNA(MATCH($B$2:$B$22,$A$2:$A$22,0)),ROW($B$2:$B$22)-ROW($C$2)+1),ROWS($C$2:C2))))

    Another tip...

    If you index the entire column then you don't need to calculate an "offset correction":

    =IF(ISERR(SMALL(IF(ISNA(MATCH($B$2:$B$22,$A$2:$A$22,0)),ROW($B$2:$B$22)),ROWS($C$2:C2))),"",INDEX(B:B,SMALL(IF(ISNA(MATCH($B$2:$B$22,$A$2:$A$22,0)),ROW($B$2:$B$22)),ROWS($C$2:C2))))

    However, the OP is using Excel 2007/2010 so we can just use the IFERROR function:

    =IFERROR(INDEX(B:B,SMALL(IF(ISNA(MATCH(B$2:B$22,A$2:A$22,0)),ROW(B$2:B$22)),ROWS(C$2:C2))),"")

  8. #8
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,156

    Re: Trying to cross check Column A with Column B

    @Tony Valko
    1st tip is good. didnt notice it, thanks

    for 2nd tip, i'm always a little reluctant to use the whole column. and for IFERROR, here's part of my signature:
    Unless if you ask for an XL2007 formula, i will try to use old formulas so that it can be applied to xls files
    Last edited by benishiryo; 01-02-2013 at 10:35 PM.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to cross check Column A with Column B

    I didn't notice that in your sig.

    Fair enough!

  10. #10
    Banned User!
    Join Date
    10-14-2006
    Posts
    1,211

    Re: Trying to cross check Column A with Column B

    Quote Originally Posted by benishiryo View Post
    @Tony Valko
    1st tip is good. didnt notice it, thanks

    for 2nd tip, i'm always a little reluctant to use the whole column. and for IFERROR, here's part of my signature:
    @benishiryo, if you try to "trap error part" with older versions of Excel.

    Try it like this. It looks shorter, and more elegant.

    =LOOKUP("zzzz",CHOOSE({1,2},"",...............))

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Trying to cross check Column A with Column B

    You should note that formula will only trap errors if the data type being returned is TEXT.

+ 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