Having at least $1 million in the bank by retirement has long been a popular goal, but it isn't easy to accomplish. One of the best ways to do so is to invest in stocks, and the earlier one starts, the better. Naturally, all stocks aren't created equal, and while some will substantially contribute to making investors millionaires, others might do the opposite.

Which of these categories does pharmaceutical giant Pfizer (PFE 0.55%) fall into? Let's find out whether this drugmaker can help investors become part of the seven-figure club.

Pfizer's business is improving despite appearances

Suppose an investor starts with capital of $100,000 and has 20 years to reach $1 million. This would require a compound annual growth rate (CAGR) of 12.2%, which isn't easy to pull off. Investors might rightly be skeptical regarding Pfizer's ability to deliver such returns in the next two decades. For one, the company's performance has been catastrophic this year. Also, even in the past 20 years, Pfizer hasn't been able to beat the market -- quite the opposite, in fact.

PFE Chart

PFE data by YCharts

However, if the past isn't a reliable predictor of future success, past failures shouldn't cause investors to conclude that Pfizer will continue to underperform the market over the long run. After all, a lot has happened with the drugmaker lately. CEO Albert Bourla said at the beginning of this year that Pfizer was entering the most crucial 18-month stretch in its (long) history.

Bourla was talking about the string of brand-new approvals and important label expansions the company was expecting this year, and so far, things have gone almost exactly as planned. Pfizer has launched seven new products, substantially beating its typical annual number of, at most, two. Pfizer's pipeline is vast and is only getting bigger thanks to acquisitions, including that of cancer expert Seagen.

Seagen has nearly 40 cancer-focused programs. This buyout could transform Pfizer into a leader in the field of oncology, especially as it combines its deep pockets with Seagen's proven innovative abilities in this area. The $43 billion Pfizer will pay in cash is possible thanks to its success in the COVID-19 market. So although its sales are declining this year because of a slowdown in vaccinations, the drugmaker is building a solid foundation for the future.

Pfizer's work along these lines didn't start with its coronavirus-related efforts. The company significantly altered its operations in the past few years, most notably by shedding some parts of its business that were doing little to contribute to revenue and earnings growth. Pfizer is a much stronger company with better prospects than just three years ago.

Dividends matter -- a lot

In my view, Pfizer can deliver somewhat average stock market returns in the next two decades. However, there is something else to consider when looking at a stock's performance, especially over such long periods: dividends. Over the past 20 years, Pfizer's returns with and without dividends (total returns include dividends) are night and day.

PFE Chart

PFE data by YCharts

That's why maintaining a solid dividend program could be an important factor in helping Pfizer turn investors into millionaires in the future. The drugmaker has increased its payouts by just under 58% in the past decade, which is decent. Pfizer's current cash payout ratio of 112% also does not inspire confidence -- it signals that the company's current cash balance isn't enough to cover its dividends. Should investors worry about it? I think the answer is no.

Pfizer generated plenty of cash in the past two years thanks to its COVID-19 success, but it spent much of it on acquisitions. Pfizer's management is committed to growing dividends over time. Once the business stabilizes, new products start pulling their weight, and the company stops being severely affected by what transpired in the past two years -- which were highly abnormal -- Pfizer's cash payout ratio should get back to more reasonable levels.

In short, Pfizer is still a good dividend stock. Reinvesting the dividend should still be an excellent choice for long-term investors.

Don't give up on Pfizer too fast

While it is true that Pfizer has had issues this year, the company still has a lot to offer investors. Demand for innovative therapies will increase in the next two decades as the population ages. The drugmaker's strengthening lineup and pipeline, as well as its commitment to growing its dividend, should lead to much better performance soon. And over the next 20 years, my view is that it has an excellent chance of delivering a CAGR of 12.2% with dividends reinvested.

In short, Pfizer can help investors become millionaires.