I've helped a ton of first time home buyers. I have this spreadsheet that I made that I gave to them with all these expenses they didn't think of. I created it back in 2006/07 when banks were throwing money at people without even considering if they could afford it. The way it calculated, they would enter their monthly net at the top, and all their expenses, I think I had it set to 30% of their pay for mortgage as default, and it would spit out what they could afford. They could change any of the numbers, but at least they could see what it would cost them. Most went over, but never to the number the bank approved them for.
Quite a few went from... I can afford a $350K house (so the bank said) to a $225K house (after I gave them my spreadsheet to punch in numbers)
I have it somewhere on a drive. I shold find it. It even had a tax rate picker of all the towns they would be looking in. In NH this was very important, as some towns could add $750 to their monthly payment. I think I had a few low dollar buyers drop towns like Derry, Windham, Brookline out of the running because the rates were too high at that time.