fuzzy lookup amended

Flyingmeatball

Board Regular
Joined
Aug 15, 2007
Messages
65
I want to run a fuzzy lookup, but slightly adjusted way. I have many different accounting entries that are sorted by account. What I would like to do is search if anything similar to a given item has been placed in another account by accident. For example, in column A i have accounts A through D. In column A i have 3 entries for |computer hardware|, and in column B I have 1 entry for |computer hardware upgrades". I would like to fuzzy/vlookup to only return those that are NOT in the same account. Is there an easy way to do this? I have thousands of entries. Thanks!
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
I have given you a trivial sample sheet (sheet1).
copy this sheet in an empty workbooks calling the sheet "sheet1"
now run this macro on this and see sheet2 column A. If thisis what you want
you can use the macro to your file (keep original file safe)

the macro is
Code:
Sub testone()
Dim rnga As Range, rngb As Range
Dim ca As Range, cb As Range
Worksheets("sheet1").Activate
Set rnga = Range(Range("a1"), Cells(Rows.Count, "a").End(xlUp))
Set rngb = Range(Range("b1"), Cells(Rows.Count, "b").End(xlUp))
For Each cb In rngb
For Each ca In rnga
If WorksheetFunction.CountIf(cb, "*" & ca.Value & "*") = 0 Then
Worksheets("sheet2").Cells(Rows.Count, "a").End(xlUp).Offset(1, 0) = cb

End If
Next
Next
Worksheets("sheet2").Activate
Set rnga = Range(Range("a2"), Cells(Rows.Count, "A").End(xlUp))
'MsgBox rnga.Address
rnga.AdvancedFilter action:=xlFilterCopy, unique:=True, copytorange:=Range("D1")
Columns("a:c").Delete
End Sub

the sheet is as follows
Book2
ABCD
1aq
2sw
3computerhardwaree
4dkkkk
5fr
6computerhardwaret
7gcomputerhardwareupgrades
8hy
9ju
10computerhardwarellllll
11ki
12lo
13
14
Sheet1
 
Upvote 0

Forum statistics

Threads
1,215,131
Messages
6,123,223
Members
449,091
Latest member
jeremy_bp001

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