# Count Duplicate Text in two different columns in two sheets

#### nd1611

##### New Member
Hi,
I have two different excel files that I need to compare two columns of text. The text columns do not have the same number of populated cells with text and cannot be arranged so that A4 in sheet one = A4 in sheet 2. I want to be able to take the text value in column A row one from sheet one and write a condition where I search the entire range of cells, for example A1:A52 in sheet two, and if any text in that range is the same as the text in A1 from sheet one, I want a True value to show or even better, a value of one. Then A2 in sheet one would be compared to the same range on sheet two and so forth. Hopefully this makes sense. An answer would be much appreciated. Thanks
B

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

#### indiantrix

##### Well-known Member
First, an assumption: if you are searching for "Red" on the column in sheet#2, and one of those cells contains "Blue and red", this is NOT a match. If this assumption is valid, then in cell B1 write the following formula: =IF(ISNA(VLOOKUP(A1,[OtherBook.xls]Sheet2!\$A\$1:\$A\$52,1,FALSE)),"",1)
and copy down.
This should do the trick, providing the initial assumption is valid.
HTH /s/ Larry

##### MrExcel MVP
=ISNUMBER(MATCH(A1,Sheet2!\$A\$1:\$A\$52,0))+0

#### nd1611

##### New Member
Thanks guys, I will try these out
B

Replies
2
Views
202
Replies
1
Views
67
Replies
20
Views
394
Replies
13
Views
558
Replies
2
Views
120

1,136,696
Messages
5,677,259
Members
419,682
Latest member
M3one

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back