# how to compare data in 2 column

#### Gokrish

##### New Member
I have 357 data in column 1 and 63 data in column B. All the data in column B is contained in column A. I want to compare column A and B and get a "true" if the item in column B is in column A, or get False. So I am expecting 63 "true". Can anyone help me with this, it is kind of urgent. Thanks

### Excel Facts

Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

#### SteveO59L

##### Well-known Member
Use a vlookup(), some thing like

=vlookup(B1,A:A,1,false)

#### hayden

##### Board Regular
You could use a sumif command

assuming that col 1 is A and that your data starts in A1 then:
Code:
``=sumif(\$b\$1:\$b:67,a1,\$c\$1:\$c\$677)``

That would go in d1

Before it will work you need to put a list of 1 in c1-c67

This will return a value of 1 if the value is found and otherwise a value of 0. You can also copy this formula down from a1 - a357

Hope that helps.
hayden

#### hayden

##### Board Regular
Yeah use steves it is way easier!

#### shajueasow

##### Well-known Member
Or something like the following in Column C downwards:
=OR(EXACT(B1, \$A\$1:\$A\$357))
remember to enter it with CTRL+SHIFT+ENTER

Replies
5
Views
36
Replies
4
Views
100
Replies
5
Views
70
Replies
3
Views
71
Replies
4
Views
37

1,109,446
Messages
5,528,802
Members
409,836
Latest member
karnasrinivas

### This Week's Hot Topics

• Change military grades into rank
Afternoon all Need help with formula that will change military rank (i.e. 1, 2, 3 into Amn, A1C, SrA). Running IF formula that does not work...
• VBA COUNTIF SOLUTION
Hi The following are the errors spread across the several columns from E to Q ie. 13 columns across several sheets with more than 500 rows per...
• INSERT ROW WITH SPECIFIS TEXT IN A COLUMN
Hi All! How can identify that that the row to be inserted has to be inserted before 1st row with specific text in column F. If I record the...