Use the NPER() function, which is:
Number of Months =NPER(rate,pmt,pv,fv), where:
rate = %rate per year/12, or rate per year/1200
pmt = monthly payments, WITH A NEGATIVE SIGN IN FRONT!
pv = present value, or, for a debt, the amount of the debt
fv = future value, or, for a debt, 0.
If you need an algebraic formula, I think I can get it for you. Just post again, or send me a PM.