dawnoflife
dawnoflife

Reputation: 1652

Comparing 2 columns in excel

I am trying to compare 2 columns for similarities.
There are strings in columns A and B and I want to display when a particular row of Col A matches the corresponding row in Col B. Note some of the rows in Col A might be empty.

So, basically this => if (A1==B1), C1 = TRUE

Here's what I've tried so far:

=IF(ISERROR(MATCH(A1,B1:B1,0)),"",A1)

=EXACT(A1,B1)

=IF(A1=B1,"True",B1)

None of these give me a match for columns that contains the following data:

ColA ColB

Xanthomonas oryzae Xanthomonas oryzae

Would appreciate help with this. Thanks!

Upvotes: 1

Views: 3809

Answers (2)

chris neilsen
chris neilsen

Reputation: 53135

Since @Carl's answer does not work for you, the cell contents are not equal. Check for excess spaces or other non printing characters.

Try these

=CLEAN(A1)=CLEAN(B1)

or

=TRIM(A1)=TRIM(B1)

or

=TRIM(CLEAN(A1))=TRIM(CLEAN(B1))

Trim will remove leading and trailing spaces, Clean will remove ascii characters 0 through 31. You may need a more elaborate formula depending on where the differences lie.

Upvotes: 3

Carl Manaster
Carl Manaster

Reputation: 40336

In C1, place the formula

=A1=B1

Upvotes: -2

Related Questions