Comments on: How to compare two columns in Excel for matches and differences

The tutorial demonstrates a number of techniques to compare and match two or more columns in Excel with formulas, conditional formatting and the specialized wizard. Continue reading

Comments page 18. Total comments: 551

  1. Hai

    i have a big doubt to find the duplicate values and match the duplicate data's actual values

  2. Hi ,

    I wanted to find similar occurrences of string between two columns, If Column 1 text=Marks , then i need to find how many 'marks' in column 1 have 'pass' or 'fail' in column 2.

  3. Thanks a TON!!!!!!

  4. Thank you very much, these notes are really good and helpful for analysis.

    Best,
    Sameer

  5. I need to sort column A where there is a duplicate number in red text. All numbers that don't have a duplicate red text number need to be removed.

  6. Hello,
    I am struggling with how to compare values, and if there is a match, insert a new column. For example, sheet 1 has:
    Column A has server names, and will contain duplicates (column B contains application name, multiple app's can run on the same server)

    Another spreadsheet (sheet 2) has unique server names by Datacenter (1 Excel sheet for each datacenter). I planned on copy/paste it into column D on sheet 1. If there is a match between column A and D, add a value (the value would be the same each time, as I am pasting only datacenter 1, then datacenter2, etc.) for the Datacenter into column C.

    Hope that made sense, and thank you in advance!

    1. I think I found a useable way to get this done, but not ideal. I'll compare the values, if it matches, write MATCH in column C. Then just replace the word MATCH with the Datacenter I am running it for. After a few runs, I'll be done, since I will paste one DC at a time. :-)

  7. Hi,
    can you please tell me how to take the difference of dates in cases like:
    STARTTIME
    24-MAR-16 09.25.20.859619000 AM

    ENDTIME
    24-MAR-16 09.25.23.028557000 AM

  8. Hi!

    I would like to check if the ask how to check two columns (one reference, one data) to another two columns even if they are not same in order. For example:
    1) WORK 1 2) WORK 2
    REFERENCE DATA REFERENCE DATA
    001 RED 005 YELLOW
    002 BLUE 001 RED
    005 YELLOW 002 PINK

    ** REFERENCE 001 AND 005'S DATA ARE MATCH WITH WORK 2 DETAILS.
    BUT FOR REFRENCE 002, DATAS ARE NOT MATCH WITH WORK 1 AND WORK 2

    Even if they are not in the same order, by matching the reference and the data, I need to have a formula to know what details are not match for Work 1 to Work 2.
    Please help me with this.
    Thank you!

  9. I wann compare this two colum in One Colum

  10. Hi I want to compare just first 10 digits of the two cells.What formula can I use.

    1. Did you find an answer for this Deeba? I need it too

  11. Hi.. I have a data to sort.
    As the numbers are not in sequence in each coloumn,
    How can i make them in sequence to each other side by side.

    Eg:

    Column A Column B
    211 212
    212 214
    213 215
    214
    215

    What Im looking for is to sort column B data side by side with column A. I have 6000 numbers to sort right now.Thank you.

    What it should be Eg:
    Column A Column B
    211
    212 212
    213
    214 214
    215 215

  12. Sorry, I somehow posted before I was done writing..

    I have two sets of data to compare: Column A to Column D, and Column B to Column E. How can I write one formula to look for matches or differences? For example:
    Column A Column B Column C Column D Result
    12345AA AEP 12345AA AEP True
    12345AB AEP 12345SS HMA False

    I hope this makes sense.

    Thanks!
    Liz

  13. I have two sets of data to compare: Column A to Column D, and Column B to Column E. How can I write one formula to look for matches or differences? For example:
    Column A Column B Column C Column D Result
    12345AA AEP 12345AA AEP True
    12345AB AEP

  14. i have 2 columns a and b if the value of a and b column is "yes" the result should be displayed in c column as "resolved" but if either a or b has value no it should display as Followup,

    i was able to apply the formula in c column but when the value of a column or a and b column both becomes no it displayes as false not the Followup what part i m missing

    =IF(a:a="YES",IF(b:b="YES","Resolved","FOLLOWUP"))

  15. Hi,
    I have 6 digit alphanumeric data in Column A and B. Both are not in order and in different series. Few numbers in column A and B are same. how to find out common numbers in both column with a color highlight.

    Thank you,

  16. State Code
    New Jersey NJ
    New York NYC
    Texas TX

    If state is found in any where in the sheet.. the result should come in another column with state code.

    State State
    New Jersey
    New Jersey
    New Jersey
    New York
    Texas
    New York
    New Jersey
    Texas
    Texas
    New Jersey
    New Jersey
    New Jersey

  17. I want to keep index data with two columns (A, B) and find word in A in C column.. if A matches in C, add B in D column. Please help me with this.

    Example:
    Column A
    New Jersey
    Texas
    New YORK

    Column B:
    NJ
    TX
    NYC

    Column C:
    New Jersey
    New Jersey
    New York
    New Jersey
    Texas
    Texas
    New York
    New Jersey

    Result should be in Column D:
    NJ
    NJ
    NYC
    NJ
    TX
    TX
    NYC
    NJ

  18. Hi Dear
    I have a problem to compare figure in the same row. How can i find out the row if the difference between them is more than double.

  19. Great, Thanks a lot.

  20. I need Example 3. Highlight matches (duplicates) between 2 columns for bank Reconciling because this problem

    Column A Column B
    2 match 2 Match
    2 match

    this case only one 2 match

  21. Hi Irina Kindly give me your email so that I attach my illustrated problem.
    Thanks in advance.

  22. Please help me! I have 2 column a and b. "A" column have frutis information. "B" column have rates. The problem is a and b both have duplicate values. A have multiple time "orange". "B" have different rates sometime same rate. I have to find out does the orange has same rate all the time or different rate. If same rate than it has to display match if different rate. Than mismatch

  23. I need a mark to find duplicates in an excel sheet.

    The problem with the records are, they are not exactly the same.
    There is always one or more field(s) that differs from each other.
    I want to have an automatic way of recognizing this cases.

  24. Hi all,
    I would appreciate your help with the following:
    I would like to compare two columns, let us say Column A and Column B, looking for duplicates. If a value in Column A has a match value in Column B, I would like to format the cells of the same duplicate value with the color (the colors are random and different for each match). This is if A12 = B30, the color will be red. And if A20 = B1, the color is green and so on.

    Regards,
    Ali

    1. Hello Ali,
      I'm sorry, but there is no simple way to do this. You can have a custom tool developed for you, but as soon as there are over ten values that have duplicates, you can only use the color shades that may be difficult to differentiate.
      It may be better to create a conditional formatting rule to check duplicates of a particular value in column A and in column B, then change the rule to see the duplicates of the next value, and so on.

  25. Hi, I need help with a formula. In my example, I am comparing dates between 2 columns (production dates), and I highlight only rows where the dates do not match. I wish to add to the existing formula, so that the comparison (and highlight) is not made if a third column is >1 (which would mean the order has already been produced). My intent is to focus on as-yet unproduced orders, and eliminate the highlight on orders already in stock.

    Thank you!

    1. Hi Joseph,

      You can create a conditional formatting rule, choose to "Use a formula to determine which cells to format" and enter the following formula:
      =AND($A1<>$B1, $C1=1)
      Here columns A and B contain dates, and column C is the one to check for value "1":
      Highlight different dates based on value in column C

  26. Hi there, the article is very helpful, however I struggle with comparison where some empty cells are included.
    Your "Compare multiple columns for matches in the same row" Example 1 is what I was searching for, but it doesn't work if there are empty cells in between.
    Say A1= MARK, B1= MARK and C1 is empty, the function gives an error. How can I ignore those empty cells and still the answer to be "match".

    Thanks!

    1. Hello Yulia,
      If blanks occur only in one of three values in the same row, please use the following formula:
      =IF(AND(IF(AND(NOT(ISBLANK(A1)),NOT(ISBLANK(B1))), A1=B1, TRUE), IF(AND(NOT(ISBLANK(A1)),NOT(ISBLANK(C1))), A1=C1, TRUE), IF(AND(NOT(ISBLANK(C1)),NOT(ISBLANK(B1))), C1=B1, TRUE)), "Full match", "")

      If you may have blanks in two of three values in the same row, please use this formula instead:

      =IF(COUNTBLANK(A1:C1) > 1, "",IF(AND(IF(AND(NOT(ISBLANK(A1)),NOT(ISBLANK(B1))), A1=B1, TRUE), IF(AND(NOT(ISBLANK(A1)),NOT(ISBLANK(C1))), A1=C1, TRUE), IF(AND(NOT(ISBLANK(C1)),NOT(ISBLANK(B1))), C1=B1, TRUE)), "Full match", ""))

      1. Hi Irina,

        actually I have found another option: =IF(AND(OR(A1=B1;B1="");OR(A1=C1;C1=""));"ok";"error")

        A little bit primitive, but for the purpose works good

        Thanks
        Yulia

  27. how to check column 1 caste oc; column 2 male or female
    how to count caste oc how many female and how many male ?

    1. Hello Ram,
      It sounds like you need to add a Pivot Table. We assume your data look the following way:
      Count values in column 2 by values in column 1
      - Select your data, go to Insert tab in Excel and click on Pivot Table
      - Drag column 1 to Rows
      - Drag column 2 to Columns and to Values
      You will get a count for each oc the following way:
      Pivot table to count males and females

  28. Very useful. Very through. Fantastic

  29. Thanks, the info was very helpful...

  30. Helpul excel functions

  31. Thanks.. helpful

  32. I am wondering if possible to take column A make a match to the bestest (does not have to be 100% exact) match in column B and to say be able to copy that information back to where I want it to be. Doing some url links from data feed and testing idea's like this and hoping to come up with a better answer than doing it by hand. I got 519 rows in column A (menu name for links for website, etc) and 7546 rows in column B from data feed with the end to the links I want to make. Column A is say Women's Active Clothing Or Womens Active and Column B (has in the 7546 rows) a match like clothing & accessories > women > active (this is exact of how they look). I want to match them up then make a url out of it later like mysite.com/products/category/clothing & accessories > women > active to assign to menus like Women's Active Clothing. If any one has an idea please let me know. Am test trialing the software but yet not figured out or if possible to do some thing this hard

    1. Hello, Rod,

      For us to be able to assist you better, please send us a small sample table with your data in Excel and include the expected result. Thank you.

      1. Need some help please. I have 3 separate cells, each ca contain variable data
        e.g. Cells A1 and A2 can contain one of the following P, p, pi, pe,F, f, -, untested, Cell A3 can contain P,p,F,f,-,untested - what I want as a result in A4 is - If A1 and A2 and A3 all contain P or p(i or e also)then ALL OK, IF A1 or A2 or both contain an F or f but A3 = P or p then A4 should read T OK but prob. If Ai and A2 have P,p,pi,pe but A3 is F then A4 should read T OK up to x-point. If A1,A2 and A3 all contain an F or f then A4 should read T F
        Hope you can help - Many Thanks

  33. I've a problem in counting the number of appearing of the data in 2 adjcent cells in a same row.
    Say the row is filled with alphabet randomly, I want to find the times that "B" appears immediately adjacent to "A".
    Thank you.
    Paul

    1. Hello Paul,

      Please try the formula below for your task.

      =COUNTIF(A1:F1, "*AB*") + COUNTIF(A1:F1, "*BA*")

      Hope this helps.

  34. This was extremely helpful and thorough. Thank you!

  35. it very useful

Post a comment



Thank you for your comment!
When posting a question, please be very clear and concise. This will help us provide a quick and relevant solution to
your query. We cannot guarantee that we will answer every question, but we'll do our best :)