U.S. stocks rose Wednesday following two straight sessions of declines as investors weighed a series of corporate earnings and mixed retail data. Wednesday’s gains were led by the technology sector, while utilities, which include gas and power companies, were the largest decliner.

The Dow Jones Industrial Average (INDEXDJX:.DJI) added 3.24 points, or 0.02 percent, to 18,071. The Standard & Poor’s 500 index (INDEXNASDAQ:.IXIC) rose 2.01 points, or 0.11 percent, to 2,102. The Nasdaq composite (INDEXSP:.INX) gained 11.20 points, or 0.23 percent, to 4,987.

Microsoft Corporation (NASDAQ:MSFT), the world’s largest software company, and beverage giant The Coca-Cola Co. (NYSE:KO) led the Dow higher Wednesday, gaining 1.2 percent and 1.1 percent, respectively.

Shares of Microsoft got a boost Wednesday when Deutsche Bank upgraded the stock's rating to Buy from Hold, and raised its 12-month price target from $44 to $55 following the software giant’s Ignite event last week. Microsoft's stock is currently trading around $48 per share. 

A weak personal computer market is already priced into the stock, and there is new investor enthusiasm about Azure, Office 365 and other Microsoft products, Deutsche Bank analyst Karl Keirstead said in a research note Wednesday. “The stock is relatively cheap, and we see few downside catalysts," Keirstead said.

Meanwhile, chemical maker DuPont Co. (NYSE:DD) was the largest decliner in the blue-chip index Wednesday, dropping 6 percent. The company’s board won a proxy fight against hedge fund Trian Fund Management, led by Nelson Peltz. Trian, which is DuPont's fifth-largest shareholder, had been seeking four seats on the board.

Shares of Macy's Inc. (NYSE:M) dropped around 2 percent Wednesday after the department store’s quarterly profit missed Wall Street estimates, while revenue dipped from a year ago. The company also raised its buyback plan, announcing a 15 percent increase in its dividend on common stock and a $1.5 billion increase in its share repurchase authorization.

Notable companies reporting after the closing bell Wednesday include department store J.C. Penney Corp., burger joint Shake Shack Inc. and network equipment maker Cisco Systems Inc.

U.S. retail sales were unchanged in April after sales rebounded in March, snapping three straight months of declines due to harsh winter weather. Economists had forecast sales to rise 0.2 percent in April. March's retail sales were revised higher to a 1.1 percent increase, from a previously reported 0.9 percent rise.

The continuing weakness of retail sales in April calls into question whether the soft patch of economic data can be chalked up to the winter. “The ongoing softness of retail sales is another reason to believe that the Federal Reserve will delay the first rate hike until September at least,” Paul Ashworth, chief economist at Capital Economics, said in a research note Wednesday.