There’s more evidence to suggest putting women into top leadership roles is good for business.

A new study from S&P Global Market Intelligence found that public companies with women CEOs or CFOs often were more profitable and produced better stock price performance than many of the companies that had appointed men to those roles.

The study looked at new CEO and CFO appointments for companies on the Russell 3000 Index over the past 17 years. All told, it considered 5,825 new appointments, of which 578 were of women.

Two years after appointing a female CEO, companies were perceived by investors as being less risky, the study found. And the companies saw improved momentum in their stock prices.

Companies with women CFOs were also perceived as less risky bets by investors and were more profitable. Looking across the entire 17-year period, the study found that the women CFOs’ companies, during their tenures, generated a combined $1.8 trillion more in gross profits than their sector averages. For example, one of the firms with a female CFO generated $208.6 million in gross profits in a given quarter. That was nearly $33 million more than the $175.7 million average gross profit for companies in the same sector.

Gender diversity on boards improved as well. Researchers found that companies that appointed a female CEO had twice the number of female board members than the market average during her tenure. And they found firms with high gender diversity on their boards were more profitable than those with low gender diversity.

Women executives may be held to a higher standard

Why did the women CEOs and CFOs do so well? Did they perform their jobs differently than their male counterparts?

The study analyzed the language used in the newly appointed executives’ biographies, especially key words that reflect achievements, education and personal traits associated with success – words like productivity, technology, Wharton and leadership. It found a strong correlation between key words used in all of the women’s biographies and those found in the biographies of the most successful male executives. There was not a strong correlation, however, with the key words in the biographies of the less successful men.

The S&P researchers suggest this could mean that common attributes drive success among men and women, but that boards held the women CEOs and CFOs to a higher standard than the men before hiring them.

Or, put another way, boards hire men much more frequently, even though some of the men they appoint aren’t necessarily as qualified as some women candidates, as suggested by the outperformance of the women executives in the S&P study.

“The high male-to-female ratio of executives in C-suite positions supports this premise. Being more selective with female appointees means that the board of directors may pass over a more qualified female in favor of a less qualified male,” the researchers wrote. “If this is the case, it follows that the remaining pool of female contenders for C-suite positions remains richer with talent.”