How it's calculated: We use the formula for the number of periods (months) until depletion: N = ln( W / (W - P * r/12) ) / ln(1 + r/12) where P = balance, W = monthly withdrawal, r = annual return rate (decimal). If r = 0, then N = P / W.
N = ln( W / (W - P * r/12) ) / ln(1 + r/12)