Note: Use HTTP PUT to change the data in a cell, even if it is empty; the use of POST on empty cells is no longer recommended. To clear a cell, send an entry with an empty content element in your PUT request instead of using DELETE.
To modify a cell in a worksheet, start by creating an entry element containing the relevant data, which in this case is a formula:
<entryxmlns="
http://www.w3.org/2005/Atom"
xmlns:gs="
http://schemas.google.com/spreadsheets/2006">
<id>
https://spreadsheets.google.com/feeds/cells/key/worksheetId/private/full/R2C4</id>
<linkrel="edit"type="application/atom+xml"
href="
https://spreadsheets.google.com/feeds/cells/key/worksheetId/private/full/R2C4"/>
<gs:cellrow="2"col="4"inputValue="=SUM(A1:B6)"/></entry>
Find the edit URL for the desired cell by performing a GET request to first find the cell. The edit URL is in the href attribute of a link element which has a rel attribute set to edit.
In the body of the PUT request, place the entry element you created above, using the application/atom+xml content type.
Now, send the PUT request to the appropriate Sheets edit URL retrieved above, (replacing key, worksheetId, and cell with their appropriate values):
PUT
https://spreadsheets.google.com/feeds/cells/key/worksheetId/private/full/cell
The new data is placed in the specified cell in the worksheet. If the specified cell contains data already, it is replaced.