Categorize expenses in Google Sheets
=HUNCHPICK(text, options) reads one transaction description and returns the budget category it fits, chosen from the list you write. Point it at a bank or card export and every row gets a category, ready for a pivot, a SUMIF, or a QUERY.
Why a keyword rule breaks on a bank feed
A rule like "if the description contains hotel, mark it travel" works until a statement shows "WEWORK 285 FULTON ST", which is rent for one company and a coworking day pass for another, or "AMAZON MKTPLACE PMTS", which could be a book, a monitor stand, or an office chair. A keyword rule needs the exact word; a category formula needs only the meaning, and a bank feed rarely repeats the same merchant wording for long.
The formula
=HUNCHPICK(B2:B500, "software and subscriptions: SaaS tools, apps, cloud services|travel: flights, hotels, rideshare, parking, mileage|meals and entertainment: restaurants, coffee, client meals|office and supplies: equipment, furniture, stationery|advertising and marketing: ads, sponsorships, design tools|professional services: legal, accounting, contractors, consultants|rent and utilities: office rent, internet, power|other")In Excel: =HUNCH.PICK(B2:B500, "software and subscriptions: SaaS tools, apps, cloud services|travel: flights, hotels, rideshare, parking, mileage|meals and entertainment: restaurants, coffee, client meals|office and supplies: equipment, furniture, stationery|advertising and marketing: ads, sponsorships, design tools|professional services: legal, accounting, contractors, consultants|rent and utilities: office rent, internet, power|other")
Each option carries its own definition after a colon, so travel and meals and entertainment do not fight over a rideshare receipt to a client dinner. The category names are clear enough that the default question works: no third argument needed. Full syntax is on the HUNCHPICK reference.
Real outputs
Nine lines from a card statement export, with the model's answers as returned on 28 September 2026.
| Row | A | B |
|---|---|---|
| 1 | Transaction description | Category |
| 2 | SQ *BLUE BOTTLE COFFEE SAN FRANCISCO CA | meals and entertainment |
| 3 | AWS.AMAZON.COM SEATTLE WA | software and subscriptions |
| 4 | DELTA AIR 006 2341234567 ATLANTA GA | travel |
| 5 | GOOGLE *ADS MOUNTAIN VIEW CA | advertising and marketing |
| 6 | WEWORK 285 FULTON ST NEW YORK NY | rent and utilities |
| 7 | STAPLES STORE #4471 DENVER CO | office and supplies |
| 8 | LEGALZOOM.COM LOS ANGELES CA | professional services |
| 9 | COMCAST CABLE COMM PHILADELPHIA PA | rent and utilities |
| 10 | UBER TRIP HELP.UBER.COM | travel |
Every line lands on a specific category, none in other, because the merchant shorthand carries more signal than it looks like at first read: LEGALZOOM.COM reads as professional services and GOOGLE *ADS as advertising and marketing without anyone needing to expand the abbreviation first. WEWORK is read as rent and utilities, the coworking-membership reading rather than a one-off day pass, worth checking against your own vendor if the two ever land on the same statement.
Where the category list runs out
A statement always has a few lines that do not match anything on the list cleanly. These are worth reading before you trust the column for a full quarter.
| Row | A | B |
|---|---|---|
| 1 | Transaction description | Category |
| 2 | AMAZON MKTPLACE PMTS AMZN.COM/BILL WA | other |
| 3 | PAYPAL *NETFLIX 4029357733 | software and subscriptions |
| 4 | CHEVRON 0091234 SAN JOSE CA | other |
| 5 | APPLE.COM/BILL 866-712-7753 CA | software and subscriptions |
| 6 | INDEED.COM 512-605-1739 | professional services |
| 7 | DOORDASH*THAI PLACE SAN FRANCISCO CA | meals and entertainment |
AMAZON MKTPLACE PMTS and the Chevron gas station both land in other, exactly the generic-merchant and fuel-purchase cases the category list does not name directly. PAYPAL *NETFLIX lands on software and subscriptions, the closest available option for a subscription that is not SaaS; if personal-style subscriptions need their own line for expense policy reasons, add a category rather than leaving Netflix and a CRM bill in the same bucket. INDEED.COM reads as professional services over advertising and marketing, a reasonable pick for a recruiting cost but one worth its own definition if your team argues about where hiring spend belongs.
Read whatever lands in other once a month. If the same kind of line keeps landing there, add a category for it instead of leaving the bucket to grow.
Totals stay in normal formulas
The category column is text. Amounts, dates, and totals stay exactly where they already are, in SUMIF and QUERY, not in the model.
=SUMIF(C2:C500, "travel", D2:D500)=QUERY(A1:D500, "select C, sum(D) where C is not null group by C order by sum(D) desc label sum(D) 'total'")Column C is the category from HUNCHPICK, column D the amount from the export. Neither formula asks the model anything; they read the column it already filled. A pivot table on the same two columns gives the same total a different way, category down the rows, month across the columns, if that is the view your finance lead already trusts.
Keep the category column even after you build the summary. Next month's statement is new rows, and the summary formulas above pick up whatever the category column contains, no rebuilding required.
Limits
- The model reads only the description text. It does not see the amount, the date, or your chart of accounts, so a $4 coffee and a $4,000 vendor payment with the same merchant name get the same category.
- A range formula categorizes about 1,000 rows before Google's 30-second custom function limit gets close. A full year of statements is a job for Extensions › Hunch › Ask about selection, which writes values instead of formulas.
- Category names come back exactly as written before the colon. If your accounting software needs a code instead of a name, keep the words as the option list and
VLOOKUPthe result against your chart of accounts. - It does not know a charge repeats every month. If you want a separate recurring-subscription flag next to the category, that is a second formula, not a seventh category.
Copy the template to try this on your own export. The product categorization guide and the general classification guide cover the same HUNCHPICK pattern on other kinds of text.
Questions
Does it use the amount to help decide the category?
What about a merchant name with no useful words in it?
Can it return my chart of accounts number instead of a category name?
Will recategorizing next month's statement cost credits for merchants I already categorized?
Can I flag recurring subscriptions separately from the category?
Run it on your own column
Copy the template (or use the Excel add-in), paste your key, point the formula at your data. Every formula here has its Excel spelling underneath. 100 rows free to start, then $29 for 5,000 rows. Credits never expire and there is no subscription.
Reference: HUNCHPICK
More guides
- Categorize bank transactions in Excel Transactions
- Categorize support tickets in a spreadsheet Ticket triage
- Code open-ended survey responses in Google Sheets Survey coding
- Classify text into categories with a Google Sheets formula Classification
- Tag customer reviews by topic in Google Sheets Review tagging