+ Reply to Thread
Results 1 to 8 of 8

Identify cells with same values from two columns

  1. #1
    Registered User
    Join Date
    01-05-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    16

    Identify cells with same values from two columns

    In a spreadsheet, I have 2 columns:
    Column A contains the name of all the financial documents reports of our company.
    Column B contains the name of all the financial documents which my team has worked (these reports can be for both external clients as well as for our company)
    Ex:
    Col A Col B
    F1 F1
    F2 F4
    F3 F5
    F5 F6
    F11 F8
    e.t.c
    My task is to identify all the reports for which my team has worked. From the example, I should be able to extract the following report names: F1, F5

    Thanks in advance for all your help.

    Note: I am using MS Excell 2007 (Windows Platform)
    Last edited by streetcat; 01-06-2012 at 04:17 AM. Reason: Problem is solved :-)

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Identify cells with same values from two columns

    Hello,

    using a helper column, you can tag the rows that have a match in the other column, for example in column C

    =IF(COUNTIF(A:A,B2),ROW(),"")

    You can then use a formula to create a contiguous list of items that are found in both columns

    =IFERROR(INDEX(B:B,SMALL(C:C,ROW(A1))),"")
    Copy down as far as required.

    see attached.

    cheers,
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    01-05-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Identify cells with same values from two columns

    Quote Originally Posted by teylyn View Post
    Hello,

    using a helper column, you can tag the rows that have a match in the other column, for example in column C

    =IF(COUNTIF(A:A,B2),ROW(),"")

    You can then use a formula to create a contiguous list of items that are found in both columns

    =IFERROR(INDEX(B:B,SMALL(C:C,ROW(A1))),"")
    Copy down as far as required.

    see attached.

    cheers,
    @teylyn Thanks for the quick reply. I really appreciate it.
    This is the first time I have visited this site and I never expected that I would get the required help so soon.

    While your method did help me, I have one more favor to ask:
    We need to actually have 3 different outputs:

    1: Identify the cells with same values- your solution is perfect
    2: Identify unique values that only exist in Column A
    3: Identify unique values that only exist in Column B

    Request you to kindly assist me finding a solution.

    Once again,@ teylyn, Truly appreciate your help.

    Thanks,
    Streetcat

  4. #4
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Identify cells with same values from two columns

    Hi streetcat

    For Common Values in both columns, use this formula:

    =IF(COUNTIF($B$2:$B$6;A2)=1;A2;"")

    For Uniques values in column A, use this formula:

    =IF(COUNTIF($B$2:$B$6;A2)<>1;A2;"")


    For Uniques values in column A, use this formula:

    =IF(COUNTIF($A$2:$A$6;B2)<>1;B2;"")

    Hope to helps you.
    Attached Files Attached Files
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

  5. #5
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Identify cells with same values from two columns

    Using the same technique, you need two more helper columns, one to tag the rows for unique values in column A, one for column B. For example in column D:

    =IF(COUNTIF(B:B,A2),"",ROW())

    Then build a contiguous list of unique values in column A with

    =IFERROR(INDEX(A:A,SMALL(D:D,ROW(A1))),"")

    See attached. [edit: I've been trying to attach a file, but the forum software is in bad shape right now]

    cheers,
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    01-05-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Identify cells with same values from two columns

    Quote Originally Posted by Fotis1991 View Post
    Hi streetcat

    For Common Values in both columns, use this formula:

    =IF(COUNTIF($B$2:$B$6;A2)=1;A2;"")

    For Uniques values in column A, use this formula:

    =IF(COUNTIF($B$2:$B$6;A2)<>1;A2;"")


    For Uniques values in column A, use this formula:

    =IF(COUNTIF($A$2:$A$6;B2)<>1;B2;"")

    Hope to helps you.
    @Fotis1991 and teylyn ... Thank you so much!!!!
    My task is simplified by your easy formulas.
    I sincerely appreciate you assistance.

  7. #7
    Registered User
    Join Date
    01-05-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Identify cells with same values from two columns

    How do i notify that my question is solved?

  8. #8
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Identify cells with same values from two columns

    Click the Edit button on your first post in the thread, Click Go Advanced, select [SOLVED] from the Prefix dropdown, then click Save Changes

+ 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