Stocks couldn't hold on to hefty early gains, but indexes posted another positive day despite an afternoon sell-off. The Dow Jones Industrial Average (^DJI 0.56%) gained 43 points, or 0.2%, and the S&P 500 (^GSPC -0.88%) added two points, or 0.1% on Wednesday:

^INX Chart

^INX data by YCharts.

In economic news, the housing market enjoyed a nice jump last month, with sales of existing homes rising 5% according to a new report from the National Association of Realtors. Average home prices also jumped 6% year over year, to $223,000. The demand uptick points to a strong spring selling season, and suggests growing consumer confidence.

Meanwhile, dozens of companies posted quarterly results on Wednesday as earnings season kicked into full swing. Those earnings reports drove unusually large price swings in both Coca-Cola (KO 2.14%) and VMware (VMW) stocks.

Coca-Cola's flat volume
Coca-Cola's 5% drop made it the worst-performing stock in either the Dow or the S&P 500 on Wednesday. The beverage titan's Q1 sales fell 4%, meeting consensus estimates, while Coke's $0.45 per share of profit edged expectations by $0.01.

Image source: Coca-Cola.

Falling soda consumption, especially in the key U.S. market, continues to pressure results. Worldwide volume growth slowed to 2% from the prior quarter's 3% thanks to what management described as a "challenging" global sales environment.

The sparkling beverage side of the portfolio didn't improve at all, marking a slowdown compared to last quarter's 2% uptick. Nonetheless, higher prices and a strong competitive position helped Coke widen its lead in the industry, while improving profitability. "We gained global volume and value share in sparkling beverages in a challenging macro environment," executives explained in the earnings release.

Coke also updated shareholders on its refranchising plans that promise to transform its sales and profit-growth profile. CEO Muhtar Kent and his team have now reached agreements on 66% of U.S. bottling territories, and expect to have all of them covered by the end of next year. Coke affirmed a full-year outlook that targets between 4% and 5% organic growth, and slightly faster profit gains.

VMware's aggressive buyback
VMware shares spiked higher by 14% after the virtualization specialist posted quarterly results and announced an aggressive stock buyback plan. Q1 numbers were solid, but not especially strong: Sales rose 5%, to $1.6 billion, as net income declined by 17% under the weight of added spending on R&D and sales and marketing. Operating margin slipped to 28% of sales from 30%, but demand for products like vSphere was strong. "We continue to see momentum across our portfolio of growth products and businesses," CEO Pat Gelsinger said.

Image source: VMware.

VMWare is set to put a large chunk of its cash flow to work in buying back shares. It announced a new $1.2 billion stock repurchase program, and it intends to spend all of that cash by the end of the year. The new program reflects "confidence we have in the business and reinforces our capital allocation strategy," Chief Financial Officer Zane Rowe said.

Meanwhile, healthy order bookings gave management confidence to boost its profit outlook for the full year. VMWare now expects to earn as much as $4.18 per share in 2016, which is just above Wall Street consensus estimates of $4.11 per share in profit.