The post above gets you to a "max payment", based on the rent, and assumptions about expenses and desired profit. In Excel, there's a function to calculate the loan amount from the payment. Its called "PV" for "present value". The forumula looks like this:
PV(interest, periods, payment)
Interest, payment, and periods need to be consistent. Since the payment is per month, we need interest per month and periods is the number of months. Payment needs to be a negative number, since the payment is going out. That is, the payment is reducing a positive "present value" (i.e., the loan amount) to zero. So, if we assume 7% interest rate (that's annual) and 30 years, the forumla is:
PV (7%/12;30*12;-380)
Other useful related functions include the NPER (number of periods) function the FV (future value) function, and the RATE function.
You can use NPER if you know the rate, payment, and current loan balance to calculate the number of payments remaining (say, for a subject to deal.)
You can use FV to calculate the loan balance in the future, once you've calculated the payment. Plug in the rate, payment you calculated, and present value (i.e., starting loan balance), and the number of payments you want to make, and you'll get the loan balance after that number of payments.
RATE can determine the current interest rate. Again, for a subject to, say the owner knows their payment, and how long they've owned the house and what they paid. But they don't remember the rate. If you can separate the insurance and taxes, you can calculate the rate.