* Corn retreats as investors buy wheat, sell corn in spread trades

* Soybeans firm on USDA report of delayed plantings in North Dakota, Minnesota

CHICAGO, May 17 (Reuters) - Chicago wheat futures rallied on Tuesday, even after India said it would allow overseas wheat shipments awaiting customs clearance, as traders focused on an unrelenting question roiling global prices: Where will the world get its grain?

The most-active wheat contract on the Chicago Board of Trade (CBOT) dipped early in the session, due to a spate of profit-taking, but ultimately settled up 30 cents at $12.77-1/2 a bushel.

India banned wheat exports on Saturday, just days after saying it was targeting record shipments of 10 million tonnes this year, as a scorching heat wave curtailed output and domestic prices hit a record high.

The government had said it would only allow exports backed by letters of credit (LCs), or payment guarantees, issued before May 13, leaving some 1.8 million tonnes of grain trapped at ports.

Wheat also received support from a U.S. Department of Agriculture report late Monday, indicating worsening condition of the U.S. winter crop, deepening worries about supply in an already-tight market.

The USDA rated 27% of the U.S. winter wheat crop in good to excellent condition, down 2 percentage points from the previous week and below analysts' expectations, while spring wheat was 39% planted, below expectations of 43%.

Meanwhile, corn futures slipped as investors were buying wheat and selling corn in spread trades, after the USDA reported that corn planting progress was improving, said Don Roose, president of Iowa-based U.S. Commodities.

"Soybeans are caught in the middle right now with another weather system forecast for later this week, and planting delays in Minnesota and North Dakota," Roose said. "That's added risk premium to the market, which is why prices are up."

CBOT corn settled down 8-3/4 cents at $8.00-3/4 a bushel, while CBOT soybeans closed the day up 21-1/2 cents at $16.78 a bushel. (Additional reporting by Enrico Dela Cruz in Manila and Sybille de La Hamaide in Paris; Editing by Marguerita Choy and Leslie Adler)