Bank Transaction Description/Merchant Cleanup & Auto Categorize (like Mint)

Poppiefresh

New Member
Joined
Aug 10, 2016
Messages
5
I can't believe I couldn't find this anywhere. All my account transactions are downloaded into an Excel spreadsheet. I want to:


  1. Cleanup the merchant name/description to be concise & understandable
    1. Run Transactions column A against the list of IFTT criteria on the AutoLookup tab and replace the value with the value from the lookup. In this example, Transactions cell A3 would match AutoLookup cell A4, so Transactions A3 would be overwritten by value in AutoLookup F4, and
  2. Auto Categorize based on AutoLookup table. Transaction cell A4 would match against AutoLookup A5 so the value in AutoLookup D5 would populate Transactions B4.

The lists will keep growing as more transactions are added so the list needs to be dynamic and not static on both tabs.
It’s too much for a lookup and VBA is not my strong suit.

https://drive.google.com/open?id=1UXJ45pVyv5fYuM5dwjY0NJZc1Ew85Vuk

open



open
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi Poppie,
Here is a MACRO that I think does what you need

Code:
Sub CleanUpSelection()
    Dim s As Range
    Dim r As Range
    Dim n As Range
    Dim c As Range
    Set s = Selection
    Set n = Worksheets("Autolookup").Range("A3..A8")
    For Each r In s.Rows
        For Each c In n
            If InStr(r.Cells(1, 1), c.Text) > 0 Then
                r.Cells(1, 1).Value = Worksheets("Autolookup").Range("$E" & Mid(c.Address, 3, 20)).Value
                r.Cells(1, 4).Value = Worksheets("Autolookup").Range("$D" & Mid(c.Address, 3, 20)).Value
            End If
        Next c
    Next
    MsgBox "Done!"
End Sub

DescriptionCategoryAmountAccount
Publix #1595 Glen Allen VA 08/13/19card 7-$ 27.56Checking
Walgreens #3681 Richmond VA 08/15/19card-$ 7.80Checking
Food Lion #1240 Richmond VA 08/11/19card-$ 10.67Checking
08/09 Wawa XXOO O-$ 36.04Checking
AFTER
Publix-$ 27.56Groceries
Walgreens-$ 7.80Groceries
Food Lion-$ 10.67Groceries
Wawa-$ 36.04Gas
Instructions
Go to Test page
Select range A2..D5
Call macro CleanUpSelection

<tbody>
</tbody>

You can test the macro in this sample file in https://1drv.ms/x/s!AovCE1fDrrdSnUVdXnq84LpLHZ_p?e=SzpX5a

Cheers
Sergio
 
Upvote 0
The macro does perform the cleanup, but I was hoping for something that would not have to be re calibrated as new records are added. The original spreadsheet is in Google Sheets and I am trying to replicate this function in Excel since I'm not a "sheets" person. In the attached, I just add the new criteria to the AutoCat tab and when I select "Run" at the top, it automatically checks the columns on the Transactions tab without having to ever indicate a stopping row. The only thing it does not do is rename the transaction to be a clearer description and not the bank gibberish. I was hoping to add that step.

https://docs.google.com/spreadsheets/d/1FJBQDqDa3h_5139lXT2-GMVEnlxgbXVKqMg55cca5nU/edit?usp=sharing
 
Upvote 0
Hi Poppie,
The only thing that has to be re calibrated in the macro is in line, the real range of normalisation data change A3...A8 with your real data range:
Set n = Worksheets("Autolookup").Range("you range here")
Your real data range is the real Autolookup Description contains normalization list range, also you know there is an easy way to define a dynamic range using xlup function and only defining the column
The other range is dynamic, it is the selected range when you call the macro, so is not defined in the macro
I hope that helps
Cheers
Sergio
 
Last edited:
Upvote 0
Like this
Code:
Sub CleanUpSelection()
    Dim s As Range
    Dim r As Range
    Dim n As Range
    Dim c As Range
    Set s = Selection
    Set n = Worksheets("Autolookup").Range("A3..A" & Worksheets("Autolookup").Range("A50000").End(xlUp).Row)
    For Each r In s.Rows
        For Each c In n
            If InStr(r.Cells(1, 1), c.Text) > 0 Then
                r.Cells(1, 1).Value = Worksheets("Autolookup").Range("$E" & Mid(c.Address, 3, 20)).Value
                r.Cells(1, 4).Value = Worksheets("Autolookup").Range("$D" & Mid(c.Address, 3, 20)).Value
            End If
        Next c
    Next
End Sub
Test file at https://1drv.ms/x/s!AovCE1fDrrdSnVVn_-bvLVh0G-5W?e=pHl803
Cheers
Sergio
 
Upvote 0

Forum statistics

Threads
1,213,529
Messages
6,114,155
Members
448,554
Latest member
Gleisner2

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