problem with classification of bank transactions with a lookup table

teemeren

New Member
Joined
Apr 26, 2024
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I have a question that I cannot find an answer to. I hope I'm posting this well, it's the first time on a forum ;)

I'm working on something of which the image below is a simplified version. I would like to be able to classify a payment in a category, based on a table that contains the classifications.
So, for every transaction on the left, with a description and an amount, I want to check wether one of the keywords in the table is found in the desciption, and if so, fill out the classification behind the keyword that is a match.
I made it work with a switch function:
Excel Formula:
=SWITCH(A3;G2;H2;G3;H3;G4;H4;G5;H5)
that goes in C3, and is copied down. However, this only works with an exact match between the keyword and the description.
I would like to be able to find the keyword within a desciption with other variables around it, as in the second case.
I tried a lot of combinations of vlookup (as here I am able to lookup a value like "*"&G5&"*"), index and match, but I'm not able figure it out. Is it a case that is only solvable by VBA? Unfortunately I'm not skilled enough in this language to produce a solution there as well.

Schermafbeelding 2024-04-27 020018.png


I hope that you guys are able to help!

with kind regards,
Tjebbe
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Try:
Book1
ABCDE
1bank descclassificationkeywordclassification
2albert hejin is okfoodikeahouse
3ikea pasunasdj 6housegoogleautomation
4google factuerne 23123automationlidlfood
5albert hjin is okfoodalbertfood
6lidl is nietfood
Sheet2
Cell Formulas
RangeFormula
B2:B6B2=XLOOKUP(TRUE,ISNUMBER(SEARCH($D$2:$D$5,A2)),$E$2:$E$5)
 
Upvote 0
Solution
Thank you so much. I do not totally follow how it works, but it does do the job! Thanks again :)
 
Upvote 0

Forum statistics

Threads
1,215,634
Messages
6,125,938
Members
449,275
Latest member
jacob_mcbride

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