Is there a formula to calculate how much loan I should take to buy a house?

There is no fixed rule, but figures suggest that if your Equated Monthly Instalments (EMIs) home loan is more than 40% of your salary, you may find it hard to pay back the loan.