After years of struggling to make the big leagues, Salesforce is now a member of the Fortune 500. Credit: Salesforce.com. 

Shares of Salesforce (CRM -1.59%) rallied from a 5.86% decline during the regular session to add more than 3% in late trading. Investors bid the stock higher on better-than-expected second-quarter results and strong third-quarter guidance. Here's a closer look at the Q2 totals versus Wall Street's projections:

CRMRevenueYOY GrowthEPSYOY Growth
Consensus estimate  $1,598.34 million  21.2% $0.17   30.8%
Q2 actual  $1,634.68 million  23.9%  $0.19   46.2%
DIFFERENCE  $36.34 million  2.7% $0.02  15.4%

Sources: S&P Capital IQ and Salesforce press release.

Commenting on the results, CEO and co-founder Marc Benioff said in a press release:

Salesforce has now blown past the $6.5 billion annual revenue run rate faster than any other enterprise software company, and we are once again raising our fiscal year 2016 revenue guidance to $6.625 billion at the high end of our range. That puts us on pace to reach a $7 billion run rate later this year, and our goal is to be the fastest to reach $10 billion in annual revenue.

What went right: After several quarters of slight declines, Salesforce improved gross margin, to 75.2% in Q2 from 74.7% in the first quarter. The fifth-basis-point improvement is a good sign in that it suggests Salesforce is largely getting the premium it's asking for in writing long-term contracts. 

What went wrong: Nothing of substance, though unbilled deferreds grew at just 24% versus 29% for currently billed work. The message? Longer-term deals may not be as easy to close as they used to be. Still, with a total of $9.63 billion either billed or contracted, Salesforce looks well positioned to make good on Benioff's hopes to be the fastest to $10 billion.

What's next: Looking ahead, Salesforce forecasts $1.69 to $1.7 billion in third-quarter revenue, resulting in $0.18 to $0.19 a share of profit after accounting for stock-based compensation and other noncash items. Analysts tracked by S&P Capital IQ have the company generating $1,675.57 million in revenue and $0.18 a share in adjusted earnings. That compares with $1,383.66 million and $0.14 a share in last year's Q3.

Longer term, analysts have Salesforce growing earnings by an average of 27.45% annually during the next three to five years. 

In the meantime, investors should pay close attention to the deferred revenue totals, as well as revenue growth compared to growth in cash from operations. They lined up almost perfectly in Q2. (Up 24% and 23.8%, respectively.) Continued alignment -- or outperformance on the cash flow line -- would indicate that Salesforce is doing a nice job of collecting cash as it signs new deals.