Compare 2 Columns and List Values That Dont Match in Column 3

yelkrab

New Member
Joined
Jan 22, 2018
Messages
3
The scenario I have is a list (Column A) of IP addresses that will be scanned/pinged. Then I have a list (Column B) of IP addresses that came back with a response. I would like Excel to compare the two lists and return the addresses that DO NOT match, the ones that did not come back with a response, and insert them in Column C. Until now I have had Excel compare Column A to Column B and highlight the matches, but moving forward this will not be efficient for identifying the addresses that DONT match. If I can have the unmatched values in Column A listed in Column C life would be easier. Thanks for any help!
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
yelkrab, Good evening.

Try to use:

C1 --> FORMULA --> =IF(A1<>B1, A1, "")

Is that what you want?

I hope it helps.
 
Upvote 0
If you're interested in a vba solution, how about
Code:
Sub NonMatch()

   Dim Cl As Range
Application.ScreenUpdating = False
   With CreateObject("scripting.dictionary")
      For Each Cl In Range("B2", Range("B" & Rows.Count).End(xlUp))
         If Not .exists(Cl.Value) Then .Add Cl.Value, Nothing
      Next Cl
      For Each Cl In Range("A2", Range("A" & Rows.Count).End(xlUp))
         If Not .exists(Cl.Value) Then Range("C" & Rows.Count).End(xlUp).Offset(1).Value = Cl.Value
      Next Cl
   End With
End Sub
This assumes that you have a header row in row1
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top