Home » excel » comparison – How to compare two columns value in excel?

# comparison – How to compare two columns value in excel?

Questions:

I have over 100k rows of data like below:

``````ALLA,ALLA,"Company1, Inc.","Company1, Inc.",PSA,PSA,1,1,FALSE,FALSE
BCCO,BCCO,"Company2, Inc.","Company2, Inc.",PSB,PSB,1,1,FALSE,FALSE
CTTP,CTTP,"Company3, Inc.","Company3, Inc.",PSC,PSC,1,1,FALSE,FALSE
CMMZ,CMMZ,"Company4, Inc.","Company4, Inc.",PSD,PSD,1,1,FALSE,FALSE
``````

I want to know how to figure if data in column 1 is the same as column 2, column 3 as column 4 and so on. How could I do that in excel?

Following Cory’s formula, I found that I can compare whole columns using:

``````=if(A:A=B:B, "yay", "aww")
``````

Problem is I have a header in the file:

``````c - symbol, symbol, c - companyname,    companyname,    c - tradingvenue,   tradingvenue,   c - tierrank,   tierrank,   c - iscaveatemptor, iscaveatemptor
``````

Shouldn’t this cause A:A=B:B to be false?

Given this:

``````   |  A  |  B  |
---+-----+-----+
1 |  X  |  X  |
---+-----+-----+
2 |  Y  |  Y  |
---+-----+-----+
3 |  Z  |  Z  |
``````

The formula `=SUMPRODUCT(--(A1:A3=B1:B3))` will tell you how many times the `A` value matches the `B` value.

You should get `3` as a result here. If, for example, you change `B3` to `Q` then it will give you `2`.

To do this on two columns without specifying the end of the range, try:

``````=SUMPRODUCT(--(A:A=B:B),--(LEN(A:A)>0))
``````

``````=IF(AND(A1=B1,C1=D1,E1=F1,G1=H1),0,1)