USA HSA accrued qualified medical expenses

107 views
Skip to first unread message

Ryan Mulligan

unread,
Nov 15, 2020, 6:56:26 PM11/15/20
to Beancount
Hi.

In the USA, you can fund a Health Savings Account (HSA) with pretax dollars that you can invest. If you incur a qualified medical expense, you are allowed to withdraw money from the HSA account tax free. As long as you properly record them, you can withdraw money equal to these expenses at any later date tax free.

In my particular case, almost 100% of my HSA balance is invested in a stock market ETF.

How would you set up accounts to track the amount you can withdraw from the HSA account tax free? It seems like maybe it has to do with setting the cost basis of the ETF in the HSA, but I wouldn't be surprised if that was overly complicating things.

Sincerely,
Ryan Mulligan

Aaron Lindsay

unread,
Nov 16, 2020, 11:14:24 AM11/16/20
to Beancount
Why does the cost basis of the investment in your HSA matter in terms of tracking the amount you can withdraw?

My understanding is that the amount you are allowed to withdraw is accounted using the cash value you withdraw *at the time you make the withdrawal*. If my understanding is correct, you would not need to account the cost basis of your investments in the HSA any differently than any other brokerage. The accounting of how much you are allowed to withdraw could be done independently.

What if you setup two accounts like:
  Expenses:Medical:HSA-Qualified
  Expenses:Medical:HSA-Withdrawn

And whenever you incurred a qualified medical expense, book it against 'Expenses:Medical:HSA-Qualified'. Then, whenever you pull money out of your HSA, move that same amount to 'HSA-Withdrawn'? It would probably be preferable to come up with some way to tie the two events together, but I haven't conceived of a simple way to do so.

-Aaron

Ryan Mulligan

unread,
Nov 16, 2020, 11:56:31 AM11/16/20
to bean...@googlegroups.com
Hi, Aaron.

I think I was trying to use the cost basis to tie it together, like maybe have one commodity for HSA dollars that can be withdrawn and one that cannot, but I think your solution is way simpler and will actually work. Thank you!

- Ryan

--
You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/FtV-1YJ17GA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/619d082d-f719-44a5-b5da-82af5aab7083n%40googlegroups.com.

Martin Blais

unread,
Nov 16, 2020, 1:41:44 PM11/16/20
to Beancount
Yes. I was going to suggest something very similar, using a fake commodity and some level of discipline. Basically, when you spend on health care, decrease A / increase B some other pair of accounts, and when you withdraw from the HSA, decrease B / increase C. B tracks how much $ you should be allowed to withdraw from the account at any time.

A: Expenses:Healthcare:Spent
B: Assets:BalanceClearedToWithdraw  (choose a better name)
C: Expenses:Healthcare:Withdrawn

Commodity: HSAUSD ("HSA withdrawal dollars")






--
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.

Ryan Mulligan

unread,
Nov 16, 2020, 11:25:08 PM11/16/20
to bean...@googlegroups.com
Hi.

Thanks! Just so we're all clear, I made a ledger about how I would expect Martin's proposal to play out and attached it.

Sincerely,
Ryan Mulligan

You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/FtV-1YJ17GA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhPDOnjG3S9AEHpyNbj9Qpc%2BbRxJ6Gk1cfqAN3gF4wT%2Bnw%40mail.gmail.com.
ledger.beancount

Martin Blais

unread,
Nov 17, 2020, 12:46:26 AM11/17/20
to Beancount
You got it, precisely that.
If you want to get more hip (hipper?) you could modify this plugin:
which automates something similar for IRAs, or perhaps even generalize it so it's not IRA specific and can work in any such scenario.
This way you wouldn't even have to explicitly update those accounts.
I think the plugin can be generalized.





Ryan Mulligan

unread,
Nov 17, 2020, 11:53:42 PM11/17/20
to bean...@googlegroups.com
Cool. I can get pretty far with the existing plugin. I just have to add a posting flag when withdrawing. Attached the updated ledger using the ira_contribs plugin.

Ryan

ledger.beancount
Reply all
Reply to author
Forward
0 new messages