The spreadsheet allows you to measure your future net worth on the assumption that you pay all cash, then measure it again on the assumption that you take a mortgage, and see where you end up in each case. The spreadsheet calculates your net worth year by year in both cases. I will illustrate the process, using my own assumptions, which will be simplified to make the explanation easier to follow.
I assume you are purchasing a house for $180,000 and your nest egg also amounts to $180,000. You can use the nest egg to pay for the house, or you can leave it untouched and borrow the $180,000. (Of course, the spreadsheet also allows any combination in between, such as making a 20 percent down payment from the nest egg and borrowing the balance.) The loan would be a 30-year fixed-rate mortgage at 6 percent with a monthly payment of $1,079. I assume that you have $1,500 of income on top of that available for investment.
Hence, if you take the mortgage, you have $180,000 plus $1,500 a month to invest. If you pay all cash, you have no lump sum to invest, but you do have $2,579 available every month, which is the $1,500 plus the mortgage payment of $1,079 you wouldn't be making. I assume you are in the 28 percent tax bracket, which provides tax savings on the mortgage interest, and a tax payment on the investment income.
The most important determinant of the outcome is the assumed rate of return on investment compared to the mortgage rate. For example, if you earn 6 percent on your investments, matching the rate you pay on the mortgage, your net wealth after 15 years is $831,602 if you borrow the $180,000, and $831,599 if you pay all cash. If the rates are the same, future wealth will be the same -- the trivial difference I found is a rounding error.
These numbers understate the actual wealth you would have because I have assumed zero property appreciation. Since the future value of the house will be the same regardless of how you finance the purchase, appreciation has no bearing on which mode of financing is better.
Now let's assume that you can earn 9 percent on your investments. This is a reasonable assumption if you invest in a diversified portfolio of common stock. It is an appropriate assumption if you are young enough to have a long time horizon, and can maintain an equable disposition in the face of short-run fluctuations in your wealth. On this assumption, your wealth after 15 years would be approximately $1.05 million if you borrow compared with $961,556 if you pay all cash.
Rule number one is simple: If the rate of return on your investments exceeds the mortgage rate, borrowing leaves you better off than paying all cash.