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 17. Total comments: 551

  1. I have a spreadsheet that needs to be alpha dominant where column A is a lower alpha character and column B wants to be a higher alpha character relative to column A.
    An example of this is.
    Column A Column B
    ABC DEF

    However, if the columns A and B values are flipped where it is not the correct output such as will be incorrect.
    Column A Column B
    DEF ABC

    I need a formula to weed out the lower alpha to higher alpha issue on a spreadsheet with thousands of rows.

    Thanks

  2. I read this article and its great but I haven't found solution to my problem.
    I need to compare every to cells in a column that belongs to same object in 2 rows.
    I mean for each object (out of many objects) I have 2 rows and multiple columns and for every each of this columns I need to compare every 2 cells (that are one row after another) to see if the data is the same, if not then I need to highlight the 2 cells.
    I hope someone can understand me and answer me. I need some condition or maybe to write a command in Macro.

  3. I have large amount of data,

    Example
    COL-A " PIPE SEAMLESS API 5L Gr. B PSL2 NACE+HIC 3/4"(20 MM) SCH 80 PLAIN END ASME B36.10M "

    COL B- " PIPE SEAMLESS API 5L GR B PSL2 NACE + HIC 0.75 SCH 80 PLAIN END ASME B36.10M "

    I want to find the difference in content of cell,
    e.g in example difference between COL-A & COL-B is {3/4"(20 MM) & 0.75}

    Can anyone help?

  4. Hi,

    I have 1 spreadsheet with 4 separete text tables. Each table contains a code on the first column and a description on the second.

    How can I highlight the mtaching letters sequence or identical words on the second column (description) of two considered tables?

  5. I have 2 excel worksheets. 1st sheet contain 900 names with details in 9 columns.
    2nd sheet is with 600 names (which are available in above 900) but with different details in 6 columns.
    I want to merge the details of 2nd list of 600 with those details of 600 available in the 900 name list.
    How to do this.

  6. Hi I have beeen stuck in a problem I have data with mulipt column with simlier values but different lenght =INDEX($B$2:$B$6,MATCH($D2,$A$2:$A$6,0))
    but problem is i have four columns withe common values in one two or three oe all four like your banan expmale so i want to extract the rspective values for common values in multiple columns how it will work tell me please or some other method

  7. Its very good site, which is useful and saved my one week manual effort.

    Regards,
    Satish

  8. I've been searching for a solution to this, but have so far haven't found an answer.

    In a soccer league consisting of several matches there are a number of two differing outcomes to a specific criteria.

    Here's a summary:

    League and Result
    ASIA: East Asian Championship Won
    ASIA: East Asian Championship Lost
    ASIA: East Asian Championship Women Lost
    ASIA: East Asian Championship Women Won
    AUSTRALIA: Brisbane Premier League Won
    AUSTRALIA: Brisbane Premier League Lost
    AUSTRALIA: Brisbane Premier League Won
    AUSTRALIA: Brisbane Premier League Lost
    AUSTRALIA: Brisbane Premier League Lost
    AUSTRALIA: Brisbane Premier League Won
    AUSTRALIA: Capital Territory Won
    AUSTRALIA: Capital Territory Won
    AUSTRALIA: Capital Territory Won
    AUSTRALIA: Capital Territory Won
    AUSTRALIA: Northern NSW Lost
    AUSTRALIA: Northern NSW Won
    AUSTRALIA: Northern NSW Lost
    AUSTRALIA: Northern NSW Won
    AUSTRALIA: Northern NSW Lost
    AUSTRALIA: Northern NSW Won
    AUSTRALIA: Northern NSW Lost
    AUSTRALIA: Northern NSW Lost

    What I want to do is create a report that lists each league and counts the number of Wins and Losses in each:

    League Criteria
    ASIA: East Asian Championship Won 1
    ASIA: East Asian Championship Lost 1
    ASIA: East Asian Championship Women Lost 1
    ASIA: East Asian Championship Women Won 1
    AUSTRALIA: Brisbane Premier League Won 3
    AUSTRALIA: Brisbane Premier League Lost 3
    AUSTRALIA: Capital Territory Won 4
    AUSTRALIA: Northern NSW Lost 5
    AUSTRALIA: Northern NSW Won 3

    I've looked at Pivots, and that goes some of the way there. But I can't figure out how to count the number of wins and losses in each of the leagues.

    Many thanks :)

  9. row to row cheque the same the
    numbar

  10. hi....
    I need a help to compare two sheets but it should compare the entire row only if there first column matches.
    for example:

    Sheet1
    Row ID Order ID
    32298 CA-2012-124891

    26341 IN-2013-77878

    25330 IN-2013-71249

    13524 ES-2013-1579342

    Sheet2
    Row ID Order ID
    32298 CA-2012-124891
    26341 IN-2013-77878
    25330 IN-2013-71249

    here suppose row number 2,4,6 are blank or u can say contains other data. But need to compare row only when rowID matches...
    32298==32298 but they are in different row numbers

  11. Sorry, that earlier post was accident :)

    Hi!
    How can I make Excel sheet which compares Game result to my quess? And then I get points depends how good was my quess.
    Here is small Example

    Result My quess Points
    0-1 0-2 4 winner right and one value right
    1-1 1-1 10 Both values right = 10 points
    1-1 2-1 0,5 One value right
    1-2 0-3 3 Winner right, both values wrong
    0-0 1-2 0 Both values wrong

  12. Thanks very informative content

  13. Hi can someone help me how i can compare two sheets columns and that compared cells has to be seen in other sheet. i consider it will very great i mean it may more visible

  14. Hi, I need to show in a cell the number of rows that have value in any of the cells in it and give me the column titles.

    example CFGA
    3

    because: there were three rows in the celection that had value only in columns CF and GA out of celected 4 columns.

    Will greatly appreciate it.

  15. Hi.. I would like to compare 2 different spread sheet data in excel. each spread sheet contains 15 columns and 1000 records. I would like to write a formula to know whether the spread sheet one data is matching with all the columns of spread sheet two or is there any change in each column. please let me know.

  16. I would like to compare two different spreadsheets. The first spreadsheet has several names that are the same but with different criteria. Ex:

    First column will have:
    John Smith
    John Smith
    John Smith
    John Smith
    Peter Tom
    Peter Tom
    Peter Tom
    Charlie Jones
    Charlie Jones

    Second column next to John Smith will have
    Apples
    Oranges
    Pears
    Bananas

    On another worksheet I have John Smith then next to it Pears. What I want to do is to see if John Smith that has Pears is on the first worksheet.
    Can anyone assist me?

  17. how to get the sum for the folowing values in excel with out draging the mouse
    ColumnA ColumnB ColumnC
    1234 05:00
    1234 03:30
    1234 05:00
    1234 03:30
    1234 05:00
    1234 03:30 =Totalhrs?
    5678 05:00
    5678 03:30
    5678 05:00
    5678 03:30
    5678 05:00
    5678 03:30 =Totalhrs ?

    I want total hrs of 1234 and 5678 in columnC with some formulas urgent please

  18. how to get the sum for the folowing values in excel with out draging the mouse
    ColumnA ColumnB
    1234 05:00
    1234 03:30
    1234 05:00
    1234 03:30
    1234

  19. how to get the sum for the folowing values in excel with out draging the mouse
    ColumnA ColumnB
    1234
    1234
    1234
    1234
    1234

  20. I'm trying to find how to write a formula for this scenario (pseudocode as follows): If Status="A" and dueDate contains a value, OR if Status = "C" (No dueDate info needed in this part), then it's True. Is there a way to have a formula order similar to If(OR((Status="C"),AND(Status="A",dueDate""),True, False))), or am I completely off track? Thank you in advance!

  21. Hai

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

  22. 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.

  23. Thanks a TON!!!!!!

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

    Best,
    Sameer

  25. 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.

  26. 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. :-)

  27. 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

  28. 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!

  29. I wann compare this two colum in One Colum

  30. 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

  31. 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

  32. 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

  33. 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

  34. 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"))

  35. 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,

  36. 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

  37. 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

  38. 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.

  39. Great, Thanks a lot.

  40. 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

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

  42. 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

  43. 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.

  44. 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.

  45. 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

  46. 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

  47. 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

  48. Very useful. Very through. Fantastic

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

  50. Helpul excel functions

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 :)