How to account for expenses withdrawable from an HSA

140 views
Skip to first unread message

Matt Carter

unread,
Nov 29, 2023, 2:24:31 PM11/29/23
to Beancount
I've been managing my finances with spreadsheets for a few decades.  A couple weeks ago, a coworker introduced me to Beancount and double entry accounting and I've been pleased with how well it handles my accounts.

One type of accounting that I haven't yet figured out how to do with Beancount (or double entry accounting in general) is tracking expenses that are eligible for withdrawal from a special purpose account like a Health Savings Account (HSA) or a 529 account.  (These are USA tax advantaged accounts which allow funds to be invested and withdrawals can only be made tax- and penalty-free for a specific purpose, like health or higher education.  Since funds are invested free of capital gains tax, withdrawals are often postponed till long after the eligible expense is incurred.)

I can track my HSA in Beancount as an Assets:HSA account.  As I incur HSA-eligible expenses, what's the best way to track those so that I know I can later withdraw them from the HSA?  Suppose I pay $100 to a doctor for an office visit.  In Beancount, I'd add a transaction that decreases my Assets:Cash account and increases my Expenses:Health account, each by $100.  But what that fails to capture is that $100 became eligible for withdrawal from my Assets:HSA account.

I suppose I could make it work by introducing 2 new accounts:

2023-11-29 * "Dr. Hu" "pain killers"
    Assets:Cash               -100.00 USD
    Expenses:Health            100.00 USD
    Liabilities:HSA-Eligible  -100.00 USD
    Expenses:HSA-Eligible      100.00 USD

Then, later, I could withdraw it from the HSA:

2035-06-22 * "HSA withdrawal using eligible expenses"
    Liabilities:HSA-Eligible   100.00 USD
    Assets:HSA                -100.00 USD

But the duplicate Expenses account makes me feel like the model doesn't fit reality well.

Ben Blount

unread,
Nov 29, 2023, 3:12:23 PM11/29/23
to bean...@googlegroups.com

Those are two distinct operations and many people deliberately delay reimbursement to give the money more time to grow tax free, so that two transaction method looks ideal to me.


--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/cc24b99b-905d-476a-8a14-7c58cade7489n%40googlegroups.com.

Martin Blais

unread,
Nov 29, 2023, 10:00:41 PM11/29/23
to bean...@googlegroups.com
I think the second transaction does not reflect the actual cash transfers.
I would do it either this way:

2023-11-29 * "Dr. Hu" "pain killers"
    Assets:Cash               -100.00 USD
    Expenses:Health            100.00 USD

2035-06-22 * "HSA withdrawal using eligible expenses"
    Assets:HSA                -100.00 USD
    Assets:Cash                100.00 USD

But that doesn't track the amount you can withdraw.
Another option is to use the tracking accounts; I would do it like this:

2023-11-29 * "Dr. Hu" "pain killers"
    Assets:Cash               -100.00 USD
    Expenses:Health            100.00 USD
    Income:HSA-Eligible       -100.00 USD
    Assets:HSA-Eligible        100.00 USD

2035-06-22 * "HSA withdrawal using eligible expenses"
    Assets:HSA                -100.00 USD
    Assets:Cash                100.00 USD
    Assets:HSA-Eligible       -100.00 USD
    Expenses:HSA-Eligible      100.00 USD

Note that it's not super obvious that you can deduct the amounts you pay.

I have an example out-of-network case whereby the amounts I pay get reimbursed by insurance and it's only the portion that isn't reimbursed that I end up able to claim from the HSA. Here, I turned it into a doc for you:



--

Matt Carter

unread,
Nov 30, 2023, 6:00:19 PM11/30/23
to Beancount
Thank you for the quick and helpful response, Martin!

You're right, my proposal had problems, e.g., it failed to represent withdrawal from the HSA to another asset account.

The tracking accounts solution you proposed in response is elegant.  The only thing I don't like about it is that it creates fictitious income and assets, so the balance sheet and income statement would be inaccurate.  That problem could be solved by using a made-up currency (HSA-eligible dollars) instead of the real currency (USD) for the tracking accounts.

However, after studying your Beancount - Tracking Medical Claims document, I think that the clever trick of creating equal payable and receivable amounts you illustrated there would work well here.  Here's how it could look in my hypothetical scenario:

2023-11-29 * "Dr. Hu" "pain killers"
    Assets:Cash                      -100.00 USD
    Expenses:Health                   100.00 USD
    Liabilities:AccountsPayable:HSA  -100.00 USD ; Payable from HSA someday
    Assets:AccountsReceivable:HSA     100.00 USD ; Receivable from HSA someday

2035-06-22 * "HSA withdrawal using eligible expenses"
    ; Part 1, Withdrawal from HSA:
    Assets:HSA                       -100.00 USD
    Liabilities:AccountsPayable:HSA   100.00 USD
    ; Part 2, Deposit to checking:
    Assets:Checking                   100.00 USD
    Assets:AccountsReceivable:HSA    -100.00 USD

Thanks again, Martin, for the detailed response.  And thank you for Beancount!

Reply all
Reply to author
Forward
0 new messages