I'm using Gnucash. I'd like to create "virtual subaccounts" for my debit account to keep track of expenses.

E.g: debit account --> groceries

  • Regular "virtual payment" to groceries every month

  • Automatically assign new transactions with e.g. the word "Walmart" in the Description to groceries and subtract the amount from the "groceries"-account.

What I've tried in GnuCash:

  • I successfully imported csv transactions from csv

  • I assigned the bulk to the debit account

  • I assigned individual transactions to liability accounts in expenses during import

GnuCash seems to do what I want, but it always wants to reconcile payments and mixes up new transactions with old ones randomly during import. Also I have to delete transactions one at a time, when I've made a mistake during CSV-importing.

Is there a way to get Gnucash to do what I want?

  • This doesn't answer your question, but to "undo" a bad import, you could just go back to a previous backup. I think by default GnuCash backs up every 5 minutes. (Though I set mine to an hour to avoid the 10 second freeze during the backup since my file is fairly large.)
    – TTT
    Commented Sep 16, 2019 at 19:01

2 Answers 2


You say that you want to create "Groceries" as a "debit" account. If I understand your question correctly, that is an Assets or Liabilities account, as opposed to an Expense account. This would result in a mess, as you've found.

The more usual way to set up the accounts is to have your bank account or petty-cash account set up as an Assets account (or perhaps your credit card account as a Liabilities account) and have "Groceries" as an Expenses account.

Then you'd go into your bank account (or petty cash, etc) and enter the transaction with "Walmart" in the Description column and "Expenses:Groceries" in the Transfer column.

When it comes time to reconcile your accounts, you just need to reconcile your bank accounts (not Expenses accounts such as Groceries).

You can then select the transaction you just entered, and click on "Schedule" in the ribbon bar just below the menus and make it a recurring transaction. This satisfies the 2 bullet points in the goal stated in your question: you get a regular 'virtual transaction' that has 'Walmart' and the regular amount filled in, and subtracted from your bank account, except that it's just a regular transaction (not a virtual one), and the withdrawal is reflected in the accounting for your bank account.

Of course, when you reconcile your bank account, you'll need to adjust for the actual amounts withdrawn. With the above setup, it might be simpler to just enter each grocery transaction when you actually do the grocery. You can copy and paste transactions via the Transaction menu to help make the process a little less tedious.


I have found a workaround:

During CSV-import in Gnucash, I assign the bulk of transactions to "expenses>miscellaneous" and reconcile the transactions to subaccounts of the debit-account.

This way, gnucash learns to automatically assign my transactions and I get to have sub-accounts for every category.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .