The countif function can also be used, but as I know only in VBA, it follows the code. That can be converted to Excel Function or be created as UDF.
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets(1)
rLastA = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
rLastB = ws.Cells(ws.Rows.Count, 2).End(xlUp).Row
For i = 1 To rLastA
Set c = ws.Cells(i, 1)
Set rng = ws.Range(ws.Cells(1, 2), ws.Cells(rLastB, 2))
x = Application.WorksheetFunction.CountIf(rng, c)
If x < 1 Then Valores = Valores & vbNewLine & c
Next i
MsgBox Valores
Can be performed with functions by
Count if the value of one cell in column A is equal to that of all in column B; and then if the counter value is 0 (no match), then returns the cell value name of column A if there is no match
Other ways to do it with VBA is by using .Find
, Loop com condicional
, Loop de Autofiltro
and Scripting.Dictionary
, and if the spreadsheet is too large the last two are more efficient.