Crunch reports in Google Sheets and ask about the numbers
Connect Google Sheets to the AI agent: sheets, ranges and cell values. The agent answers from the data, writes reports and appends rows with the totals of the day.
How the agent works with Google Sheets
The agent calls the Google Sheets API v4 and works with the spreadsheet whose link or identifier you gave: it reads sheets, ranges and cell values. From those it answers your question about the numbers without the file being opened, assembles a finished report with a header row, auto-sized columns and values above your threshold highlighted, matches two ranges by key and puts the discrepancies on a separate sheet sorted by the size of the difference.
The Sheets API has no file listing: it opens exactly the spreadsheet you addressed, and it is not searchable by title. One Google trap of its own: an uploaded .xlsx opens in the browser but returns an error over the API until it has been re-saved into the Google Sheets format. And a cell with a formula holds two things at once — the formula itself and the calculated value — so the agent requests whichever of them the task needs.
Appending and overwriting are different operations, and the agent does not confuse them: appending the totals of the day adds a row at the end of the sheet and leaves what was entered by hand above it untouched, while overwriting a range erases everything that was in it, formulas included. So before an overwrite the agent reads the range, and when the source data is better left alone it puts the result on a separate sheet: reconciling two ranges spoils neither of them.
Connecting is a sign-in to a Google account in a separate window; access to spreadsheets and to the account address is requested, and Google Drive is not part of it. The agent addresses ranges in A1 notation and fetches them in one batched call rather than cell by cell, so a wide report does not run into the rate limit halfway through. If there is no access to the file or the sheet is empty, it says so directly instead of showing an empty table.
Integration scenarios
A finished report in a spreadsheet
The agent gathers the numbers, creates a sheet and writes the report range by range — with a header row, auto-sized columns and values above your threshold highlighted.
Answers from the data on a sheet
The agent reads the sheets and ranges it needs and answers your question about the numbers, without making you open the file and flip through tabs.
Scheduled append of daily totals
On a schedule the agent appends a row with the totals of the day to the end of the summary sheet, leaving everything entered by hand above it untouched.
Reconciling two sheets
The agent matches two ranges by key, collects the discrepancies on a separate sheet and sorts them by the size of the difference.
Overwriting a range without losses
The agent reads a range before overwriting it and shows which formulas would be erased, replacing the values only once you have confirmed the change.
Formulas and their values
The agent shows where a cell holds a formula and where a hand-typed number, and returns whichever of the two the task needs instead of quietly swapping one for the other.
Google Sheets examples
Нашёл 27 расхождений из 1 340 строк, собрал их на лист «Сверка».
- Сопоставил «Остатки» и «Поставка_июль» по колонке артикула
- Отсортировал по величине разницы: сверху −118 шт по SKU 40-221
- 6 артикулов есть только в поставке — вынес отдельным блоком
Сверка листов
Document · DOCXHow to connect
Before you connect
- A link to the spreadsheet or its ID: the agent cannot search by title.
- Access to spreadsheets and the account address; Google Drive is not included.
- 1
Check the files show at sheets.google.com
Open sheets.google.com and check the files you need are visible under that account: the agent sees exactly what that account sees.
- 2
Ask the owner for “Editor” via “Share”
Ask the file owner to click “Share” and add your address with the “Editor” role. With “Viewer” or “Commenter” the agent only reads: writing cells will fail.
- 3
Excel: “File”, then “Save as Google Sheets”
An uploaded .xlsx opens in the browser but returns an error over the API. Open it, pick “File” → “Save as Google Sheets” and work with the resulting copy.
- 4
Mark the app “Trusted” under API controls
In a corporate domain an admin opens “Security” → “Access and data control” → “API controls” in the Admin console and marks the app as “Trusted”.
FAQ
By signing in to your Google account in a separate window: you approve access to spreadsheets, there are no keys to copy. The agent sees exactly the files that account sees, so ask for other people spreadsheets to be opened up with the Share button and the Editor role.
Sheets, ranges and cell values of the spreadsheet you gave a link to. The Sheets API has no file listing, so a spreadsheet is addressed only by a link or the identifier inside it.
Yes: it overwrites ranges, appends rows to the end of a sheet, clears cells, adds and renames sheets, and applies formatting, sorting and conditional rules.
An .xlsx file opens in the browser but cannot be read over the API and returns an error. Open it and choose File → Save as Google Sheets — the agent then works with the resulting copy.
Google spreadsheets are exactly what it works with: the agent reads the sheets and ranges of the spreadsheet you gave a link to, answers on the figures and writes the result back — appending to the end of a sheet, or overwriting a range after your confirmation.