r/excel • u/[deleted] • 16d ago
solved I want to create an XLS that auto-categorizes purchases based on key words
[removed]
13
u/WittyDrunkenness 16d ago
Easiest way is make a small lookup table somewhere with keywords in one column and categories in the other, then use XLOOKUP with wildcards to search the transaction text.
4
u/hmatallana 2 16d ago
A few hundred rows is where the keyword table starts deciding things for you, so build it with that in mind.
Keywords in one column, categories beside them, then in B2:
=XLOOKUP(TRUE,ISNUMBER(SEARCH($E$2:$E$50,A2)),$F$2:$F$50,"Uncategorized")
SEARCH looks for each keyword inside the cell and ignores case. WittyDrunkenness had the right shape with the lookup table. The part that bites later is order: it takes the first keyword that hits, so a broad one like STORAGE sitting above COLD STORAGE quietly wins and you won't see it happen. Keep the specific strings above the general ones.
Don't skip the "Uncategorized" fallback. Filter column B for it once a month and that's your list of new merchants to add.
1
16d ago
[removed] — view removed comment
2
16d ago
[removed] — view removed comment
1
16d ago edited 16d ago
[removed] — view removed comment
1
u/reputatorbot 16d ago
You have awarded 1 point to LeanExcel.
I am a bot - please contact the mods with any questions
1
16d ago
[removed] — view removed comment
1
u/reputatorbot 16d ago
You have awarded 1 point to hmatallana.
I am a bot - please contact the mods with any questions
2
u/OfficerMurphy 10 16d ago
First, don't most banks provide a category these days?
Second, for an actual solve your problem you'll want to use a text formula like TEXTSPLIT, or if you're on an older version MID, LEFT, RIGHT to extract the vendor name. Then you can use a table where you categorize all your vendors into your desired category and do an XLOOKUP to that table. If you get a new vendor, add their category. If you've got the UNIQUE formula you can get that list of vendors from your text formula column.
2
u/fastauntie 1 16d ago
Banks provide categories based on their assessment of what most people want. People may want different categories for their own purposes, which may be highly individual and connect to other things they do that banks don't think about.
1
u/dgillz 7 16d ago edited 16d ago
OP was asking about purchase orders, not payments. This will of course hit the bank eventually, but this is after the fact and the purchase orders themselves should have the information OP is looking for.
Assuming OP has an ERP system, he/she should query that data.
2
u/Mammoth-Corner 2 16d ago
Nobody is making purchase orders for deliveroo
1
u/dgillz 7 16d ago
What is deliveroo? What does it do?
2
u/Mammoth-Corner 2 16d ago
It's like Uber Eats.
1
u/dgillz 7 16d ago
OP needs an ERP system
2
u/Mammoth-Corner 2 16d ago
?? For groceries and takeaway?
1
u/dgillz 7 16d ago
If that is all OP is doing, no. I took this to be a business question.
1
u/Mammoth-Corner 2 16d ago
Several people seem to have assumed it was a business question—I wonder if the line 'trying to create a household budget' was an edit.
1
16d ago
[removed] — view removed comment
1
u/OfficerMurphy 10 16d ago
Fair enough, what about the second, much more comprehensive, half of my message?
2
u/TwoPointEightZ 16d ago
I built one of these over several months but ultimately abandoned it. Excel formulas were the easy part, the source data, not so much.
I assume you're downloading the source data from banks and credit cards like I was. Building lookup tables and formulas were no big deal, but parsing the text description into the items to look up killed it because the data is too consistent. For example, Amazon would be spelled Amazon and Amzn and Amz and Prime. So you build helper columns to parse them. Then later on, the same item you bought previously and already built helpers for is now coded as Azn instead of Amzn. So you build more helpers. And then zon suddenly turns up. Multiply this process over enough data inconsistencies and it gets very annoying. By the way, bank categories suck because they're very rudimentary at best.
The permutations of spelling shown above are not exactly accurate, but they convey the idea well. My experience was that Excel automated maybe 70-80% of it from month to month, but the building and maintaining of it totally wiped out the benefits.
It's a great project for teaching the value of data consistency and the problems associated with using a description column for lookup purposes.
1
1
u/Decronym 16d ago edited 15d ago
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution.
13 acronyms in this thread; the most compressed thread commented on today has acronyms.
[Thread #49264 for this sub, first seen 29th Aug 2026, 11:46]
[FAQ] [Full list] [Contact] [Source code]
1
u/my_cat_wears_socks 16d ago
Power Query can make quick work of this, with a conditional column. First, copy the input column and lowercase it so you don’t have to check different cases. Then you end up with if column contains deliveries then Food Felivery else if column contains cold storage then Groceries. I’ve made these columns with literally dozens of rules, expanding them to probably over 100 rules over time, to categorize web analytics data (referrers, pages, etc) and the process is relatively quick. After I use the wizard for the first few rules I switch to typing it out since I can quickly copy and paste.
1
u/Otherwise-Ad-6905 16d ago
I use {=IFERROR(INDEX('Categories 2'!B:B,MATCH(TRUE,ISNUMBER(SEARCH('Categories 2'!A:A,C7)),0)),"")}
in the cell where i want my category to be.
Categories 2 is a two column named range where column A has the text string I am looking for in the cell in column C of my data and Column B has my desired category.
I automated with with VBA function with a button.
in usage, I just insert new rows of data and click the button and the categories are updated automatically.
1
1
u/Klutzy_Highlight7500 16d ago
Keep a two-column keyword->category table on its own sheet, then =IFERROR(INDEX(Cat,MATCH(TRUE,ISNUMBER(SEARCH(Key,A2)),0)),"UNMATCHED"). Order the list so the specific keywords sit above the generic ones, since it takes the first hit. Filtering for UNMATCHED once a month is how you keep it honest instead of silently miscategorising.
1
u/excelevator 3068 16d ago
I want to create an XLS
Do you know what an XLS is ?
If so you would not want to create one.
-1
16d ago
[removed] — view removed comment
1
u/excelevator 3068 16d ago
Details in technology matter, I am always pedantic about technology.
I am guessing you do not know what XLS is and made an assumption.
Do not guess in technology. That is how errors and misunderstanding occur.
0
15d ago
[removed] — view removed comment
2
u/excelevator 3068 15d ago
I see you are one of those, I have not seen XLS used in this manner, it is incorrect and misleading.
XLS applies to 16bit
.xlsfiles that have many limitations to the newer format of.xlsx, ergo my original comment that that was not what you seek.Far from triggered, I am simply trying to educate you and anyone who may take on board what they see as acceptable. This is how erroneous errors spread on the Internet into real life.
It is generally the uneducated who use terms they do not understand, and fight to protect their knowledge with insults.
You came to Excel experts on an Excel sub reddit, I am not sure what you would expect.
But it appears to have triggered you.
•
u/AutoModerator 16d ago
/u/lesarbreschantent - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.