NPER
Financial

Returns the number of periods for an investment

Syntax:

=NPER(rate, pmt, pv, [fv], [type])

Example:

=NPER(0.12/12, -100, -1000, 10000)