Count the matches in two excel columns

Closed
3542 - Oct 17, 2009 at 11:11 PM
venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 - Oct 18, 2009 at 08:29 PM
Hello,
I am trying to compare the numbers in e82:i83 to numbers in e109:n110 and count the number of matches with the total to show in another cell, n82. I am running windows XP and Excel 97. It seems simple to me but I have tried everything I know and have read with no satisfactory results. Any help is appreciated.

3542

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Oct 18, 2009 at 08:29 PM
I wonder whether your ranges are correct. The two ranges
overlap.

any how I have given the macro. change to correct ranges.

Sub test()
Dim r As Range, r1 As Range, c As Range, j As Integer
Dim cfind As Range
Range("N82").Clear
Set r = range("E82:I183")
Set r1 = range("E109:N110")
For Each c In r
Set cfind = r1.Cells.Find(what:=c.Value, lookat:=xlWhole)
If Not cfind Is Nothing Then j = j + 1
Next c
Range("N82") = j
End Sub
0