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

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
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,215,360
Messages
6,124,489
Members
449,166
Latest member
hokjock

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