To pass an Excel file to AI without losing meaning, first identify what you need from the workbook: formulas, saved calculation results, or a separate table for analysis. Specify the required sheets and ranges, expand merged header values, and preserve the link between rows and their source. Uploading a file by itself does not prove that the AI received current calculations and all required data.
This FAQ is for analysts, business process owners, and developers who prepare XLSX files with sales, requests, or inventory balances for AI analysis. It covers workbook properties and documented ways to read them with Python. File upload capabilities, limits, and the compute environment of a specific AI service require separate verification.
Vladimir Lomtev AI Studio · Documentation verified November 12, 2026. The examples below are suggested scenarios based on official documentation. While preparing this article, Excel, Python examples for reading workbooks, and upload to an AI service were not run; analysis quality and formula recalculation were not measured.
Contents:
- Why does AI see a formula, blank cell, or old number instead of the result?
- How can you tell whether formula values are current?
- Why was only one sheet read, and how do you select the others?
- Do you need to delete hidden sheets, rows, and comments?
- Why do gaps appear after merged cells?
- What should you do with multi-row headers and "Total" rows?
- Why does a date turn into a number or the time change?
- Is it better to pass the original XLSX, CSV, or a separate values table?
- Is it enough to ask AI to "not change anything in Excel"?
Why does AI see a formula, blank cell, or old number instead of the result?
A formula and its saved result are different data. In openpyxl, the data_only=False parameter allows formulas to be read, while data_only=True returns the saved values of formula cells. This is not a recalculation command: the library does not compute formulas itself. This behavior is described in the workbook reading guide and the formula reference.
For example, in a sample requests workbook, column F contains a cost calculated from quantity and rate. In the interface, an employee sees a number, while a reader program may retrieve the expression string. If there is no saved result, reading in values mode will not create one. If the source data changed without a current recalculation, the presence of a number alone does not prove it is up to date.
Clarify the task: explain the calculation or analyze the final amounts. For the first, you need formulas and the values of dependent cells. For the second, you need confirmed results. The request "look at the Excel file" leaves that choice hidden.
For developers, the documented double read of a single cell is shown below. You need Python, installed openpyxl, and a local copy of report.xlsx with the Requests sheet. The code does not save the workbook; it was not run for this editorial piece.
from openpyxl import load_workbook
formulas = load_workbook("report.xlsx", data_only=False, read_only=True)
values = load_workbook("report.xlsx", data_only=True, read_only=True)
try:
print("Formula:", formulas["Requests"]["F2"].value)
print("Saved value:", values["Requests"]["F2"].value)
finally:
formulas.close()
values.close()
The expected sign of a successful read is two clearly labeled outputs for the same cell coordinate. This example does not verify that the saved number matches the current calculation. An error about a missing sheet means you first need to confirm its exact name.
How can you tell whether formula values are current?
A single data_only flag is not enough. You need a calculation confirmed by the workbook owner in the appropriate spreadsheet app and a copy saved after that recalculation. Then compare the selected source cells, formulas, and results in the app and in the export. This is a suggested workflow, not a file check performed here.
Start with a copy agreed on with the report owner. Ask them to confirm the reporting period, the source exports, and the status of external sources. After a normal refresh and recalculation in the app you use, save a separate file for transfer. The openpyxl documentation describes reading a previously saved result, but does not promise that it is current: load options.
In a training example, it is useful to verify one ordinary row, one row with a changed rate, and the total for the selected period. This is not a standard sample size: for a critical report, the scope of verification is determined by the process owner. If the rate comes from an unavailable external workbook, mark the dependency as unresolved. Asking a language model to guess the rate cannot be considered restoring the calculation.
For transfer, record the version name, snapshot date, and the agreed set of metrics. The file modification date helps distinguish copies, but by itself it does not confirm the data date inside the file.
Why was only one sheet read, and how do you select the others?
With pandas.read_excel the default is sheet_name=0: the first sheet is read. You can specify a name, a list of sheets, or sheet_name=None to get a dictionary of tables by sheet. These options are described in the pandas.read_excel reference. Sheet names are also available separately through ExcelFile.sheet_names.
So the phrase "the file has inventory and sales" does not yet define the analysis input. A suggested workflow: list the sheets, choose the required ones by name, define the purpose of each, and only then combine the data. The Archive sheet may contain a different period, and the Reference sheet may contain code explanations that cannot simply be appended to the end of sales data.
For a sample report, define the input like this: "Use the sales rows from the November Sales sheet; take department names from the Departments sheet; exclude the Draft sheet." Link the sheets by an agreed key. The same row position on two sheets is not a substitute for a linkage key.
The result of preparation is a clear list of selected tables and the rule used to join them. If the AI service does not show which sheets it extracted, ask it to list the sources it found first and compare the answer with the workbook. This is a supporting check, not proof of complete parsing.
Do you need to delete hidden sheets, rows, and comments?
Hiding data is not the same as deleting it. Microsoft describes checking hidden rows, columns, sheets, comments, properties, and external links in the Document Inspector.
So the visible report tab does not define the full contents of the file being sent. Check a copy of the workbook before sending it to an external service. In desktop Excel, the documented path to the inspector is: File → Info → Check for Issues → Inspect Document; the names may differ depending on the interface language. Review which categories were found and agree on how to handle them with the data owner.
Do not click "Remove All" without reviewing dependencies. Microsoft warns that removing hidden data can change formulas, and undo may not always be available. The Inspector also has detection limitations for objects. Details are in the Microsoft guide to hidden data.
For AI tasks, it is often more convenient to prepare a separate workbook with only the allowed value table. This is a recommendation for minimizing the scope of the data transfer, not a guarantee that sensitive information is absent. Check the copy itself: names, free text, and the permitted columns may still contain information that should not be sent to the chosen recipient.
Why do gaps appear after merged cells?
In openpyxl, the value of a merged range is tied to the upper-left cell; the other positions are represented without their own values. After unmerging, the label is not automatically duplicated across the rows. This explains the merged cells documentation.
Imagine a table where the word “North” visually spans several department rows. A person treats it as applying to all records, but when extracted, the data may look like this:
| Department | Request | Comment |
|---|---|---|
| North | Z-101 | Replacement needed |
| blank | Z-102 | Delivery rescheduled |
| blank | Z-103 | Question about the deadline |
For a prepared table, you can explicitly repeat “North” in all records related to it. But first confirm the boundaries of the original merged range. The rule “fill every blank with the previous value” is dangerous to apply to the entire workbook: a blank may mean an unknown department or a separator between blocks.
A separate pandas nuance: when using index_col , gaps may be filled for backward compatibility with merged cells. The documentation recommends assigning the index after reading with set_index if you want to avoid that fill: index_col description. This is specific parameter behavior, not a universal rule for handling all empty cells.
What should be done with a multi-line header and “Total” rows?
First determine which rows are actual records and which describe the table. In pandas, the header parameter sets the header row; a list of rows creates multi-level column names, and header=None is used when there is no header. See Excel reading parameters. Further transformation should preserve the business meaning of the columns.
In the proposed structure, instead of two levels “Sales → Actual” and “Sales → Plan,” create unambiguous fields sales_actual_rub and sales_plan_rub, if the original amounts are truly in rubles. Record the units and period in the data description. Do not turn different metrics into two columns with the same name “Amount.”
Handle “Total” rows according to their role. If you are passing detailed transactions, keep the total separately as a control value. Adding it to the transactions during later summation will cause double counting. If the workbook contains only ready-made totals by department, that is a different level of detail — label it that way in the input.
For a training request table, one row should mean one request, not an alternation of requests, headers, and subtotals. Successful preparation gives a clear answer to the question: “What does one record represent, and can its amount be added to the neighboring one?”
Why does a number appear instead of a date, or why does the time change?
In XLSX, dates can be stored as ISO 8601 strings or as numbers, and their meaning depends on the date system and the cell format. openpyxl accounts for these representations; Excel also uses the 1900 and 1904 date systems. Date and time in Excel do not include a time zone. These details are described in the openpyxl date documentation.
Do not send the model a raw number and ask it to determine the date on its own. Extract the value with the workbook context in mind, then assign a consistent representation. For a calendar day in a training export, you can use 2026-11-12. For an event timestamp, you also need the known source time zone; it cannot be recovered from the column name.
For example, if requests are logged in Moscow time, that must be a rule of your system confirmed by the data owner. Convert the time to UTC according to that rule. For a shipment date without time, adding artificial hours and offsets only creates unnecessary precision.
A practical sign of correct preparation is that the calendar day in the selected source cells and in the export matches, including the month boundary. This is the suggested reconciliation criterion; the actual workbook dates were not checked here.
Is it better to send the original XLSX, CSV, or a separate value table?
Choose based on the task. To explain calculations, keep a copy of the XLSX and the needed dependencies. For topic analysis of comments, a prepared set of records with an identifier and text is convenient. For recurring calculations and data history, it is useful to design a typed storage layer separately. The format itself does not define the analysis rules.
| Task | Suggested input | What to keep alongside it |
|---|---|---|
| Explain a sum calculation | Allowed workbook fragment with formulas | Dependency values and coordinates |
| Group the reasons for contacts | Table of identifiers and comments | Sheet and original row number |
| Compare sales by period | Aligned metric values | Period, currency, level of detail |
| Build repeatable analytics | Tables with defined types and keys | Field schema and update rules |
In the proposed record, preserve provenance: the workbook version name, sheet, and original row. Then the AI’s note can be returned to the owner of the specific record. After sorting the prepared table, its current row number no longer replaces the source coordinate.
Errors in SKUs and prices during text export are discussed separately in the article “CSV for AI: How to Preserve SKUs, Leading Zeros, and Prices”. There is also material on the structure and use of Parquet. These tasks begin after the workbook data set has been defined.
Is it enough to ask AI to “not change anything in Excel”?
That kind of prompt expresses intent, but it does not define how to read, calculate, and save the workbook. For integration, separately specify the allowed sheets, input fields, output format, and whether writing is allowed. If the task requires only an analytical note, ask for text and source-row references while keeping the original file separate.
Do not use overwriting the original as an intermediate preparation step. openpyxl warns that opening and saving existing files can lose unsupported elements, such as shapes: save limitations. In addition, when inserting and deleting rows, the library does not manage all dependencies of formulas, tables, and charts: editing limitations.
For a high-level analysis of inquiry reasons, you can ask the model to suggest a topic for each record and return its identifier. Attach the topic to the source data in a separate step by that identifier. Even then, the resulting answer still needs review for omissions and unverified conclusions; preserving an XLSX file and producing accurate classification are different properties of the process.
If you need to write back into a workbook with macros, links, and complex formatting, design a separate workflow and verify the result in the application you use. This FAQ did not test that scenario.
How Vladimir Lomtev's AI Studio helps prepare workbooks for AI
Vladimir Lomtev's AI Studio focuses on data preparation, MVP development, and AI integration with business systems. For spreadsheet analysis tasks, this may include:
- preparing input tables with aligned fields, units, and source traceability;
- developing and testing an MVP that sends selected data to a model and returns results by identifier;
- integrating the agreed process with enterprise systems.
The first step is to choose one report, identify its owner, data sources, and transfer constraints, and describe the current workflow and the criteria for the desired result. For example, decide whether you need an explanation of formulas or a thematic summary of comments: the inputs for these tasks are different. Discuss the task.
Bottom line: what exactly to send to AI
Send a defined data set with a clear meaning: the required sheets, verified values or formulas, unambiguous headers, dates, and source coordinates. If it is unclear how current the calculation needs to be, first resolve that with the workbook owner. For the first task, choose one table and one analysis output—this makes it easier to determine where Excel preparation ends and model work begins.



