How to Analyze Excel and CSV Files with Gemini: Complete Data Analysis Tutorial (2027)

Published: November 24, 2026
Last reviewed: November 24, 2026
Difficulty: Beginner to Intermediate
Estimated reading time: 23 minutes

Businesses generate enormous amounts of data.

Sales transactions, website statistics, customer records, financial reports, marketing campaigns, and operational performance metrics are often stored in Excel spreadsheets or CSV files.

However, collecting data is only the beginning.

The real challenge is turning that information into useful insights.

Which products generate the most revenue? Why are sales declining? Which customers purchase most frequently? Are there unusual transactions? What should management investigate next?

Traditionally, answering these questions required Excel formulas, pivot tables, SQL queries, or programming knowledge.

Google Gemini provides another approach.

You can upload spreadsheet files, describe what you want to investigate in natural language, and ask Gemini to analyze the information.

It can help explore datasets, explain relationships, suggest calculations, prepare visualizations, and develop business reports.

But how accurate is AI-powered spreadsheet analysis?

Can Gemini analyze Excel and CSV files directly?

Can it clean data, create charts, calculate business KPIs, and process thousands of records?

And when should you use Python instead of relying on AI-generated calculations?

In this complete guide, you’ll learn how to analyze Excel and CSV files with Google Gemini, beginning with a simple sales dataset and progressing to professional data-analysis workflows.

We’ll also explore Google Sheets, Python, pandas, automation, common errors, and best practices for validating AI-generated findings.

Key Takeaways

  • Google Gemini supports analyzing uploaded Excel and CSV files through supported Gemini app workflows.
  • You can ask natural-language questions about sales, customers, marketing performance, and other tabular data.
  • Gemini can help identify trends, summarize information, suggest formulas, and create charts.
  • Google introduced expanded spreadsheet creation and editing capabilities in the Gemini app during 2026.
  • Gemini in Google Sheets can manipulate tables, formulas, charts, and pivot tables through supported natural-language operations.
  • Excel files may need to be converted to Google Sheets to use some of the native Sheets editing features.
  • CSV files contain tabular values but do not preserve formulas, formatting, charts, or multiple worksheets.
  • AI-generated calculations can be incorrect. Verify important figures with Excel, Google Sheets, SQL, or Python.
  • Python and pandas are useful for repeatable data preparation, validation, aggregation, and reporting.
  • The Gemini API can analyze structured summaries prepared by your software without requiring direct spreadsheet-file processing.
  • For professional analysis, use deterministic tools for calculations and Gemini for interpretation, explanations, and reporting.
How to Analyze Excel and CSV Files with Gemini - Complete Data Analysis Tutorial (2027)
How to Analyze Excel and CSV Files with Gemini – Complete Data Analysis Tutorial (2027)

1. Can Google Gemini Analyze Excel and CSV Files?

Yes.

Google Gemini supports working with common spreadsheet and tabular data formats.

These include:

  • Excel workbooks (.xlsx)
  • Older Excel spreadsheets (.xls)
  • Comma-separated values (.csv)
  • Tab-separated values (.tsv)
  • Google Sheets files through supported integrations

You can upload a supported file and ask Gemini questions about its contents.

For example:

Analyze this sales spreadsheet.

Identify the highest-performing products, monthly revenue trends, and unusual transactions.

Prepare a concise management summary.

Gemini can assist with interpreting the data and suggesting useful analyses.

However, the actual capabilities depend on the interface and account.

Three Ways to Analyze Spreadsheet Data with Gemini

MethodBest forProgramming required?
Gemini appUploading Excel or CSV and asking questionsNo
Gemini in Google SheetsEditing spreadsheets, formulas, pivots, and chartsNo
Gemini API + PythonAutomated data analysis and reportingYes

Each method has advantages.

For a beginner, uploading a file to Gemini is usually the simplest starting point.

For ongoing spreadsheet work, Google Sheets provides a conventional editing environment.

For automated reporting or large datasets, Python can provide greater control and reproducibility.


2. Understanding Excel vs CSV Files

Before analyzing a dataset, it’s useful to understand the differences between Excel and CSV.

Excel Files

Microsoft Excel workbooks commonly use the .xlsx format.

An Excel workbook can contain:

  • Multiple worksheets
  • Formulas
  • Charts
  • Pivot tables
  • Cell formatting
  • Named ranges
  • Data validation
  • Tables
  • Financial models

An Excel file is more than a collection of values.

It may also contain business logic.

CSV Files

CSV stands for Comma-Separated Values.

A CSV file stores tabular data in a plain-text format.

For example:

date,product,quantity,unit_price
2026-11-01,Laptop,2,850.00
2026-11-02,Monitor,3,240.00
2026-11-03,Keyboard,5,45.00

A CSV file typically contains a header row followed by records.

Unlike Excel, it does not preserve spreadsheet formulas, multiple tabs, charts, or cell formatting.

Excel vs CSV Comparison

FeatureExcel XLSXCSV
Multiple worksheetsYesNo
Cell formattingYesNo
Spreadsheet formulasYesNo
ChartsYesNo
Pivot tablesYesNo
Plain-text formatNoYes
Easy to process with PythonYesYes
Supported by Gemini appYesYes

For straightforward data analysis, CSV files are often convenient.

For financial models or reports requiring formulas and formatting, Excel is usually more suitable.


3. How to Upload an Excel File to Gemini

Let’s begin with the simplest workflow.

Step 1: Open Gemini

Visit:

Sign in with your Google account.

Step 2: Prepare Your Excel File

Before uploading, check the workbook.

Make sure:

  • Column headings are clear.
  • Important worksheets are identifiable.
  • Dates and numeric values use consistent formats.
  • Unnecessary personal information has been removed.
  • The file does not contain confidential data you are not authorized to upload.

For complex workbooks, consider creating a simplified copy containing only the relevant data.

Step 3: Upload the File

Select the file attachment or upload control in Gemini.

Choose your Excel workbook.

Wait until the attachment is ready.

Step 4: Enter an Analysis Prompt

For example:

Analyze the attached Excel workbook.

First, identify the available worksheets and their columns.

Explain the structure of the data.

Then identify the main business metrics that can be calculated.

Do not calculate anything until you’ve explained the dataset structure.

Flag missing values and ambiguous columns.

Step 5: Review Gemini’s Understanding

Check whether Gemini correctly identifies:

  • The relevant worksheets
  • Column headings
  • Reporting periods
  • Numerical fields
  • Categories
  • Units
  • Missing information

Step 6: Request the Analysis

Once the dataset structure is understood, ask more specific questions.

For example:

Calculate total revenue by product and by month.

Identify the highest-revenue products.

Explain any important changes over time.

Clearly separate calculations from interpretations.

Important

An uploaded workbook can contain data that Gemini misinterprets.

Check that the relevant worksheet and records were actually included before relying on its findings.


4. How to Analyze a CSV File with Gemini

The workflow for CSV files is similar.

Step 1: Open the CSV File

Inspect the file using Excel, Google Sheets, or a text editor.

Check whether:

  • The delimiter is correct.
  • Column names are consistent.
  • Rows are complete.
  • Dates use a predictable format.
  • Numerical values are properly represented.
  • Character encoding is correct.

Step 2: Upload the File

Open Gemini and attach the CSV file.

Step 3: Ask Gemini to Inspect the Dataset

Example Prompt

Analyze the attached CSV file.

Identify:

  • Number of records
  • Column names
  • Data types
  • Missing values
  • Duplicate records
  • Invalid or unusual values

Explain any data-quality problems before performing further analysis.

Step 4: Ask Business Questions

For example:

Which products generated the highest revenue?

Or:

How did total revenue change from month to month?

Or:

Which transactions should be investigated because their values are unusual?

Step 5: Validate the Findings

Check important calculations using spreadsheet formulas or a deterministic program.

This is particularly important for financial and operational reporting.


Part 1: Practical Sales Data Analysis Tutorial

5. Example Dataset: Small Business Sales

Let’s work with a fictional sales dataset.

Imagine that you own a technology retailer.

You sell laptops, monitors, and accessories.

You want to understand revenue performance.

Example CSV Data

Create a file named:

sales_2026.csv

Paste the following data:

date,product,category,quantity,unit_price
2026-10-03,Laptop,Computers,2,850.00
2026-10-05,Monitor,Displays,3,240.00
2026-10-09,Keyboard,Accessories,5,45.00
2026-10-15,Laptop,Computers,1,850.00
2026-11-02,Monitor,Displays,4,240.00
2026-11-06,Keyboard,Accessories,8,45.00
2026-11-10,Laptop,Computers,3,850.00
2026-11-14,Mouse,Accessories,10,25.00

This dataset contains eight fictional transactions across October and November 2026.

The columns are:

ColumnDescription
dateTransaction date
productProduct name
categoryProduct category
quantityUnits sold
unit_priceSelling price per unit

Revenue can be calculated as:

quantity × unit_price

The example assumes that prices are in euros, excluding discounts, returns, taxes, and shipping.


6. Use Case 1: Analyze Total Sales Revenue

Upload the example CSV file.

Then ask Gemini:

Analyze the uploaded sales dataset.

Calculate total revenue using quantity multiplied by unit price.

Show the revenue for each transaction and the overall total.

Use euros as the currency.

Do not include tax, discounts, or shipping.

Explain the calculation method.

Expected Analysis

Gemini should identify the necessary numeric columns and calculate revenue.

For example:

  • Two laptops at €850 each generate €1,700.
  • Three monitors at €240 each generate €720.
  • Five keyboards at €45 each generate €225.

The same calculation applies to the remaining transactions.

Why Verification Matters

An AI-generated explanation can contain arithmetic mistakes.

For important figures, calculate the result using Excel, Google Sheets, or Python.

You can also ask Gemini to provide the formula rather than relying on its final numerical answer.


7. Use Case 2: Analyze Revenue by Product

A useful business question is:

“Which products generate the most revenue?”

Example Prompt

Group the transactions by product.

Calculate total quantity sold and total revenue for each product.

Sort products by revenue in descending order.

Explain which products contribute most to sales.

Use the uploaded data only.

Recommended Output Format

ProductUnits soldTotal revenue
LaptopCalculatedCalculated
MonitorCalculatedCalculated
KeyboardCalculatedCalculated
MouseCalculatedCalculated

Business Interpretation

The analysis can help identify:

  • Best-selling products by quantity
  • Highest-revenue products
  • Differences between unit volume and revenue
  • Opportunities for further investigation

Important Distinction

High revenue does not automatically mean high profitability.

Profitability also depends on product costs and other expenses.

If the dataset does not contain costs, Gemini should not invent profit margins.


8. Use Case 3: Analyze Monthly Revenue Trends

Monthly reporting is common in business analytics.

Example Prompt

Analyze revenue by calendar month.

Calculate total revenue for October and November 2026.

Show the percentage change between the two months.

Explain the main contributors to the change.

Do not infer business causes that cannot be established from the dataset.

What Should You Look For?

  • Total revenue by month
  • Changes in sales volume
  • Contribution by product
  • New products appearing in the data
  • Potentially unusual transactions

Important

A dataset containing only a few transactions cannot necessarily support conclusions about long-term business trends.

It may demonstrate a change between two observed periods without explaining why that change occurred.

The distinction between observation and causation is essential.


9. Use Case 4: Identify Unusual Transactions

Anomaly detection is another useful application.

For example, you might want to identify:

  • Unusually large orders
  • Zero or negative prices
  • Unexpected quantities
  • Duplicate transactions
  • Missing dates
  • Invalid product categories

Example Prompt

Review the uploaded transactions for data-quality problems and potential anomalies.

Identify unusual prices, quantities, missing values, duplicate records, and inconsistent product names.

Explain why each record has been flagged.

Distinguish definite data errors from transactions that are merely unusual.

Why This Matters

An unusual transaction may be valid.

For example, a large order could represent an important wholesale purchase.

Do not automatically delete or correct records simply because Gemini identifies them as anomalies.


Part 2: Clean Excel and CSV Data with Gemini

10. Why Data Cleaning Matters

Business data often contains inconsistencies.

Examples include:

  • Missing values
  • Duplicate records
  • Different date formats
  • Inconsistent product names
  • Extra whitespace
  • Text stored in numeric columns
  • Incorrect currency symbols
  • Empty rows

These problems can affect calculations and reporting.

Gemini can help identify and explain them.

However, data cleaning should follow defined business rules.

Example Problem

Suppose the same product appears as:

Laptop
laptop
LAPTOP
Laptop

These values may represent the same product.

But your analysis system might treat them as different categories.

Example Prompt

Review the product column.

Identify values that differ only by capitalization or unnecessary whitespace.

Propose standardized names.

Do not modify the original data until I review the proposed mapping.

Recommended Process

  1. Identify inconsistent values.
  2. Propose a standardized mapping.
  3. Review the mapping.
  4. Apply approved changes.
  5. Preserve the original file.
  6. Recalculate relevant metrics.

11. Handle Missing Values

Missing data should not automatically be replaced with zero.

For example:

A blank quantity might mean that the value was not recorded.

It does not necessarily mean that zero units were sold.

Example Prompt

Identify missing values in every column.

Explain how missing data could affect the analysis.

Recommend whether each missing value should be corrected, excluded, investigated, or left unchanged.

Do not replace missing values without an explicit rule.

Common Strategies

Missing fieldPossible approach
Transaction dateInvestigate original record
Product nameFlag for manual review
QuantityExclude from revenue calculation pending review
Unit priceInvestigate source system
Optional notesMay remain blank

The appropriate decision depends on the business context.


12. Detect Duplicate Records

Duplicates can distort totals.

However, identical-looking rows are not always duplicates.

A customer might legitimately purchase the same product twice on one day.

Example Prompt

Identify potential duplicate transactions.

Explain which columns were used to identify duplicates.

Distinguish exact row duplicates from legitimate repeated purchases.

Do not remove records automatically.

Better Data Design

For production reporting, include a unique transaction identifier.

For example:

transaction_id

A unique identifier helps distinguish repeated purchases from accidentally duplicated records.


Part 3: Create Charts and Dashboards

13. Can Gemini Create Charts from Excel Data?

Yes.

Google’s Gemini application supports chart creation from supported uploaded spreadsheet data.

You can ask Gemini to visualize the information.

For example:

Create a bar chart showing total revenue by product.

Use the uploaded sales dataset.

Sort products by revenue.

Use euros on the value axis.

Include a descriptive title.

Gemini may generate an interactive chart that you can explore and adjust, subject to your account and feature availability.

Other Chart Ideas

  • Monthly revenue line chart
  • Sales by product category
  • Quantity sold by product
  • Customer acquisition over time
  • Marketing leads by channel

Selecting the Right Chart

Analytical questionRecommended chart
Compare product revenueBar chart
Analyze revenue over timeLine chart
Compare category contributionsBar chart
Examine two numeric variablesScatter plot
Display a small distributionHistogram
Monitor several KPIsDashboard

The chart type should reflect the underlying question.

Avoid generating charts that imply trends or relationships unsupported by the data.


14. Create an Executive Dashboard

A management dashboard presents the most important KPIs together.

For a sales dataset, useful metrics may include:

  • Total revenue
  • Orders or transactions
  • Units sold
  • Average transaction value
  • Revenue by product
  • Monthly revenue
  • Revenue growth

Example Prompt

Create a management dashboard using the uploaded sales data.

Include:

  1. Total revenue
  2. Number of transactions
  3. Total units sold
  4. Average transaction value
  5. Revenue by product
  6. Monthly revenue trend

Clearly define each metric.

Use appropriate charts.

Do not invent missing values.

Flag limitations caused by the small dataset.

Important Calculation

Average transaction value should be calculated as:

total revenue ÷ number of valid transactions

It should not be confused with average item price.

Practical Recommendation

For a recurring dashboard, use Google Sheets, Excel, or a business intelligence tool as the calculation and visualization layer.

Gemini can help generate formulas, explain trends, and prepare the accompanying management commentary.


15. Build Spreadsheets in the Gemini App

Google expanded spreadsheet generation and editing within Gemini during 2026.

You can create structured spreadsheet content from a natural-language request.

For example:

Create a monthly sales tracker with columns for date, customer, product, quantity, unit price, revenue, and sales representative.

Include formulas for revenue.

Add a monthly summary.

Use a professional layout suitable for a small business.

The Gemini web app supports previewing and editing spreadsheet files within supported workflows.

You can also open generated spreadsheets in Google Sheets or export supported formats.

Important Distinction

Creating a new spreadsheet is different from analyzing an existing workbook.

When asking Gemini to edit imported data, preserve a backup and verify that the original figures and formulas remain intact.


Part 4: Analyze Excel Files in Google Sheets

16. Gemini in Google Sheets vs Gemini App

Google Sheets provides a more complete spreadsheet editing environment.

Gemini in Sheets can assist with:

  • Creating tables
  • Writing formulas
  • Modifying data
  • Building pivot tables
  • Creating charts
  • Formatting spreadsheets
  • Analyzing data
  • Building interactive spreadsheet applications

During 2026, Google expanded Gemini’s spreadsheet-editing capabilities.

Google also introduced Sheets canvas, which allows eligible users to create interactive applications based on spreadsheet data.

When to Use Each Product

RequirementRecommended tool
Upload a CSV and ask questionsGemini app
Analyze an Excel workbook conversationallyGemini app
Edit cells and formulasGoogle Sheets
Create pivot tablesGoogle Sheets
Build an interactive spreadsheet dashboardGoogle Sheets
Export an XLSX reportGemini or Sheets
Create scheduled data pipelinesPython or Apps Script

Important Excel Limitation

To use certain native Gemini editing capabilities on an Excel workbook in Google Sheets, Google instructs users to convert the file using:

File → Save as Google Sheets

This creates a Google Sheets version of the workbook.

Review complex formulas and features after conversion.


17. Use Gemini to Generate Spreadsheet Formulas

One useful application is formula generation.

Suppose your spreadsheet contains:

ColumnMeaning
ADate
BProduct
CCategory
DQuantity
EUnit price

You want to calculate revenue in column F.

Example Prompt

Write a Google Sheets formula that multiplies quantity in column D by unit price in column E.

Put the result in column F.

Explain how to apply the formula to all data rows.

Example Formula

=D2*E2

Copy the formula down the column.

Total Revenue Formula

=SUM(F2:F1000)

Revenue by Product

=SUMIF(B2:B1000,"Laptop",F2:F1000)

Average Revenue per Transaction

=AVERAGE(F2:F1000)

These formulas are examples.

Adjust the ranges according to your spreadsheet.

Important

Use real spreadsheet formulas to calculate financial values.

Gemini can help generate or explain formulas, but the spreadsheet engine should perform the calculations.


18. Use Gemini to Create Pivot Tables

Pivot tables help summarize large datasets.

For example, a pivot table can group revenue by:

  • Product
  • Category
  • Month
  • Region
  • Customer
  • Sales representative

Example Prompt

Create a pivot table from the current sales data.

Use product as the row dimension.

Use month as the column dimension.

Sum revenue as the value.

Exclude invalid transactions.

Explain any assumptions about the source data.

Recommended Review

Check that:

  • The correct data range is selected.
  • The revenue field is numeric.
  • Dates are interpreted correctly.
  • Empty rows are excluded appropriately.
  • The aggregation uses SUM rather than COUNT.
  • The results reconcile to the source data.

Why Reconciliation Matters

A pivot table can be perfectly configured yet produce misleading results if the underlying data contains duplicates or incorrect values.


Part 5: Automate Data Analysis with Python

19. Why Use Python with Gemini?

The Gemini app is convenient for exploratory analysis.

However, repeatable business reporting often requires a more controlled workflow.

For example, suppose your organization receives a sales CSV export every morning.

You want to:

  1. Read the file.
  2. Validate transaction records.
  3. Calculate business KPIs.
  4. Identify missing information.
  5. Produce a daily summary.
  6. Generate management commentary.

Python is well suited to the deterministic parts of this process.

Gemini can then help explain the calculated results.

Recommended Architecture

Excel or CSV
|
v
Python + pandas
|
v
Data Cleaning and Validation
|
v
Verified Calculations
|
v
Structured KPI Summary
|
v
Gemini API
|
v
Business Commentary
|
v
Human Review
|
v
Final Report

This architecture separates calculations from natural-language interpretation.


20. Install Python and pandas

The following example uses:

  • Python
  • pandas
  • openpyxl
  • Google Gen AI Python SDK

Step 1: Create a Virtual Environment

On Windows PowerShell:

python -m venv .venv
.\.venv\Scripts\Activate.ps1

On Linux or macOS:

python3 -m venv .venv
source .venv/bin/activate

Step 2: Install the Packages

python -m pip install -U pandas openpyxl google-genai

Why These Packages?

pandas

Reads, cleans, groups, and analyzes tabular data.

openpyxl

Provides support for reading and writing common Excel workbook formats.

google-genai

Provides Google’s supported Gemini API client.


21. Python Tutorial: Analyze Sales Data

Create a Python file named:

sales_analysis.py

Use the following code:

from pathlib import Path
import pandas as pd
REQUIRED_COLUMNS = {
"date",
"product",
"category",
"quantity",
"unit_price",
}
def load_data(file_path: Path) -> pd.DataFrame:
suffix = file_path.suffix.lower()
if suffix == ".csv":
data = pd.read_csv(file_path)
elif suffix == ".xlsx":
data = pd.read_excel(file_path)
else:
raise ValueError(
"Only CSV and XLSX files are supported."
)
missing = REQUIRED_COLUMNS - set(data.columns)
if missing:
raise ValueError(
f"Missing columns: {sorted(missing)}"
)
return data
def analyze_sales(data: pd.DataFrame) -> dict:
df = data.copy()
df["date"] = pd.to_datetime(
df["date"],
errors="coerce",
)
df["quantity"] = pd.to_numeric(
df["quantity"],
errors="coerce",
)
df["unit_price"] = pd.to_numeric(
df["unit_price"],
errors="coerce",
)
invalid = (
df["date"].isna()
| df["product"].isna()
| df["quantity"].isna()
| df["unit_price"].isna()
| (df["quantity"] < 0)
| (df["unit_price"] < 0)
)
invalid_count = int(invalid.sum())
valid = df.loc[~invalid].copy()
valid["revenue"] = (
valid["quantity"] * valid["unit_price"]
)
by_product = (
valid.groupby("product")["revenue"]
.sum()
.sort_values(ascending=False)
)
by_month = (
valid.groupby(
valid["date"].dt.to_period("M")
)["revenue"]
.sum()
)
return {
"valid_transactions": len(valid),
"invalid_transactions": invalid_count,
"total_revenue": round(
float(valid["revenue"].sum()), 2
),
"revenue_by_product": {
str(k): round(float(v), 2)
for k, v in by_product.items()
},
"revenue_by_month": {
str(k): round(float(v), 2)
for k, v in by_month.items()
},
}
if __name__ == "__main__":
file_path = Path("sales_2026.csv")
data = load_data(file_path)
result = analyze_sales(data)
print("SALES ANALYSIS")
print(result)

What Does the Program Do?

The program:

  1. Reads CSV or XLSX data.
  2. Verifies required columns.
  3. Converts date and numeric fields.
  4. Flags records containing invalid or missing core values.
  5. Calculates revenue.
  6. Aggregates revenue by product.
  7. Aggregates revenue by month.
  8. Produces a structured summary.

Important Limitations

This is an instructional example.

For production financial reporting, use a defined currency policy and decimal-safe arithmetic.

You should also handle:

  • Duplicate transaction identifiers
  • Returns and refunds
  • Tax calculations
  • Multiple currencies
  • Discounts
  • Shipping charges
  • Large-file processing
  • Database reconciliation

pandas commonly performs numeric calculations using binary floating-point values.

That may be acceptable for exploratory analytics, but it requires additional care in accounting applications.


22. Connect the Verified Analysis to Gemini

After calculating the KPIs, you can ask Gemini to generate a business interpretation.

The key principle is simple.

Python calculates. Gemini explains.

Step 1: Configure the Gemini API

Visit:

Create an appropriate API key.

On Windows PowerShell:

$env:GEMINI_API_KEY="YOUR_API_KEY"

On Linux or macOS:

export GEMINI_API_KEY="YOUR_API_KEY"

Never store real API keys directly in source code.

Step 2: Create a Python Script

Create:

gemini_sales_report.py

import json
import os
from google import genai
from sales_analysis import (
load_data,
analyze_sales,
)
from pathlib import Path
MODEL = "gemini-4-neon"
def generate_report(metrics: dict) -> str:
if not os.getenv("GEMINI_API_KEY"):
raise RuntimeError(
"GEMINI_API_KEY is missing."
)
client = genai.Client()
data_json = json.dumps(
metrics,
indent=2,
)
prompt = f"""
You are a business data analyst.
Write a concise management report using
only the verified statistics below.
Include:
1. Executive summary
2. Revenue performance
3. Product performance
4. Important observations
5. Questions requiring investigation
Do not invent facts, costs, customers,
market trends, or causes.
Do not recalculate the metrics.
Distinguish observations from
recommendations.
Verified data:
{data_json}
"""
response = client.interactions.create(
model=MODEL,
input=prompt,
)
return (
response.output_text
or "No report text was returned."
)
if __name__ == "__main__":
source = Path("sales_2026.csv")
data = load_data(source)
metrics = analyze_sales(data)
report = generate_report(metrics)
print(report)

Step 3: Run the Program

python gemini_sales_report.py

Expected Result

The program:

  1. Reads your dataset.
  2. Calculates the statistics using pandas.
  3. Sends the structured summary to Gemini.
  4. Requests a management interpretation.
  5. Prints the resulting report.

Important

The application does not upload the original Excel workbook directly through the Gemini Files API.

It converts the relevant results into text before sending the request.

This avoids dependence on native spreadsheet-file handling by the developer API.

The exact API model, SDK requirements, and billing conditions should be verified before use.

These examples have not been independently executed against a live Gemini API project.


Part 6: Advanced Data Analysis Use Cases

23. Use Case 5: Analyze Marketing Campaign Performance

Imagine a CSV file containing:

  • Campaign name
  • Advertising spend
  • Website visits
  • Leads
  • Conversions
  • Revenue

Example Prompt

Analyze the uploaded marketing campaign dataset.

Calculate conversion rates and cost per lead where the required data is available.

Compare campaign performance.

Identify unusually high or low values.

Do not invent attribution information.

Explain which additional data would improve the evaluation.

Important

Marketing revenue attribution can be complicated.

A dataset may show campaign-associated revenue without proving that the campaign caused every sale.

Distinguish correlation from causal impact.


24. Use Case 6: Analyze Customer Data

Customer datasets can reveal useful patterns.

Examples include:

  • Purchase frequency
  • Average order value
  • Customer segments
  • Product preferences
  • Customer retention

Example Prompt

Analyze the customer purchase dataset.

Identify purchasing patterns, repeat-customer behavior, and differences between product categories.

Use aggregated information wherever possible.

Avoid exposing unnecessary personal information.

Explain the limitations of the available data.

Privacy Consideration

Customer datasets may contain personal information.

Before uploading them to an AI service, verify that your use is authorized and consistent with the applicable privacy and data-processing requirements.

Where possible, use anonymized or aggregated data.


25. Use Case 7: Analyze Operational Performance

Operational datasets may contain:

  • Support tickets
  • Response times
  • Resolution times
  • Service categories
  • Employee workloads
  • System incidents

Example Prompt

Analyze the service desk performance data.

Calculate the average and median resolution time.

Identify differences between issue categories.

Highlight unusual delays.

Explain what the data shows and which conclusions require additional evidence.

Why Median Matters

A few unusually long incidents can distort average resolution time.

Comparing the average with the median can provide a more informative picture.


26. Use Case 8: Analyze Financial Reports

Financial data analysis is another relevant application.

Gemini can help explain:

  • Revenue changes
  • Expense categories
  • Budget variances
  • Cash-flow patterns
  • Financial ratios

Example Prompt

Analyze the supplied financial dataset.

Explain revenue, expense, and budget variance trends.

Clearly distinguish actual results from forecasts.

Preserve currencies and accounting periods.

Do not invent missing figures.

Identify calculations that require independent verification.

Important

Use a trusted spreadsheet or financial system for final calculations.

AI-generated financial explanations should be reviewed before they influence consequential decisions.


Part 7: Fifteen Useful Gemini Data Analysis Prompts

27. Copy-and-Use Prompt Library

Prompt 01 — Explore Dataset

“Analyze this dataset’s structure, column names, data types, missing values, and potential data-quality problems.”

Prompt 02 — Revenue Analysis

“Calculate revenue by product, category, and month. Explain the findings using the supplied data only.”

Prompt 03 — Find Trends

“Identify important trends over time. Distinguish observed changes from possible causes.”

Prompt 04 — Detect Anomalies

“Find unusual values and explain why each record may require investigation.”

Prompt 05 — Clean Data

“Identify inconsistent categories, duplicate records, and invalid fields. Propose corrections without changing the original data.”

Prompt 06 — Create a Chart

“Create a bar chart comparing total revenue by product. Use accurate labels and units.”

Prompt 07 — Build Dashboard

“Design a management dashboard containing the most important KPIs from this dataset.”

Prompt 08 — Analyze Customers

“Identify customer purchase patterns using aggregated data and explain the limitations.”

Prompt 09 — Marketing Performance

“Compare marketing campaigns using cost per lead, conversion rate, and available revenue metrics.”

Prompt 10 — Budget Analysis

“Compare actual expenses with budgeted amounts and identify important variances.”

Prompt 11 — Spreadsheet Formulas

“Generate the Google Sheets formulas required to calculate the following KPIs and explain each formula.”

Prompt 12 — Data Quality Audit

“Prepare a data-quality report identifying missing values, invalid records, inconsistent formatting, and potential duplicates.”

Prompt 13 — Compare Periods

“Compare current-period performance with the previous period and calculate supported percentage changes.”

Prompt 14 — Executive Report

“Create a management report based only on verified metrics, separating facts from recommendations.”

Prompt 15 — Recommend Further Analysis

“Identify the most important unanswered business questions and suggest what additional data would be needed.”

Prompting Recommendation

Always specify:

  • Dataset
  • Business question
  • Reporting period
  • Units
  • Required calculations
  • Output format
  • Verification requirements

A precise request produces a result that is easier to evaluate.


Part 8: Common Problems and Limitations

28. Gemini Cannot Upload the Excel File

Possible causes include:

  • Unsupported file format or feature
  • File size restrictions
  • Account limits
  • Corrupted workbook
  • Temporary service problems
  • Subscription restrictions

Recommended Solution

Verify that the file opens in Excel.

Try a smaller workbook.

Remove unnecessary sheets or embedded objects.

Convert a relevant worksheet to CSV if appropriate.

Check the current Gemini file-upload documentation.


29. Gemini Produces Incorrect Calculations

AI-generated numerical answers can contain mistakes.

Recommended Solution

Use Excel formulas, Google Sheets, SQL, or Python to calculate important metrics.

Compare the results.

Ask Gemini to explain discrepancies rather than automatically trusting its previous answer.

Important Principle

An AI model can confidently explain an incorrect calculation.

For financial analysis, arithmetic verification is essential.


30. Gemini Misinterprets Dates

Spreadsheets may contain dates formatted differently across countries.

For example:

03/04/2026

could mean March 4 or April 3 depending on locale.

Recommended Solution

Use an unambiguous ISO date format:

2026-04-03

For international datasets, define the expected timezone and reporting period.


31. Gemini Misses Important Rows

Large datasets can introduce source coverage problems.

Recommended Solution

Check the number of records.

Confirm the analyzed date range.

For large files, use deterministic preprocessing.

Provide verified summary statistics rather than assuming the model has analyzed every record correctly.


32. Gemini Confuses Revenue and Profit

Revenue and profit are different.

Revenue is money generated from sales.

Profit requires subtracting relevant costs.

If your dataset contains only selling prices and quantities, you cannot calculate profit margins reliably.

Recommended Solution

Define each metric explicitly.

Do not request profitability analysis without sufficient cost information.


33. Gemini Changes Spreadsheet Formulas

AI-generated spreadsheet modifications can accidentally alter important formulas.

Recommended Solution

Preserve a backup.

Review proposed changes.

Check totals after modifications.

For important models, reconcile results before and after editing.


34. Gemini Generates Misleading Charts

A chart can be technically correct yet visually misleading.

Examples include:

  • Inappropriate axis scales
  • Missing units
  • Incorrect time ordering
  • Misleading comparisons
  • Excessive aggregation

Recommended Solution

Verify the source data and chart configuration.

Use chart types appropriate to the business question.

Avoid visual designs that exaggerate differences.


Part 9: Best Practices for Reliable AI Data Analysis

35. Ten Recommended Practices

1. Inspect the dataset first. Confirm that the columns and values have been interpreted correctly.

2. Preserve the original file. Avoid changing source data without a backup.

3. Define the business metrics. Specify exactly what revenue, conversion, average order value, and other KPIs mean.

4. Validate data types. Ensure that dates, quantities, and prices are interpreted properly.

5. Check missing and duplicate records. Determine how these affect calculations.

6. Use deterministic calculations. Rely on spreadsheet formulas or code for exact results.

7. Ask Gemini to explain, not invent. Use verified results when requesting business interpretations.

8. Protect confidential data. Apply organizational privacy and access rules.

9. Record assumptions and limitations. Explain what conclusions the available data cannot support.

10. Review important reports. Verify figures and recommendations before publication or management use.

These practices are useful regardless of whether your AI assistant is Gemini or another model.


36. How Much Time Can Gemini Save?

Gemini may reduce the effort involved in exploring datasets and preparing reports.

However, the benefit depends on the analysis.

Illustrative Example

Imagine a business analyst who prepares a monthly sales report.

Without AI assistance, the workflow requires:

  • Data cleaning
  • KPI calculations
  • Chart preparation
  • Trend interpretation
  • Report writing

Suppose the process takes five hours.

With a combination of Python automation and Gemini-assisted commentary, the same work might take three hours, including verification.

Illustrative time saved: two hours per report.

This is a hypothetical example rather than a measured Gemini benchmark.

What Should You Measure?

Track:

  • Total analysis time
  • Data-cleaning time
  • Calculation errors
  • Manual corrections
  • Report completeness
  • Review time
  • Reproducibility
  • API costs where applicable

The goal is not simply to generate analysis faster.

It is to produce useful, verified results with less manual effort.


Frequently Asked Questions

Can Gemini analyze Excel files?

Yes. Gemini supports analyzing supported Excel spreadsheet files, including .xlsx, through the Gemini application.

Can Gemini analyze CSV files?

Yes. You can upload CSV files and ask Gemini questions about the data.

Can Gemini calculate totals and averages?

Yes, but important calculations should be verified using deterministic tools such as Excel, Google Sheets, or Python.

Can Gemini create charts from Excel data?

Yes. Supported Gemini app workflows can generate charts based on uploaded spreadsheet data.

Can Gemini clean spreadsheet data?

Gemini can identify problems and suggest corrections. Supported spreadsheet-editing workflows can also modify data, subject to review.

Can Gemini analyze multiple Excel files?

Supported Gemini workflows allow multiple file attachments, subject to account and usage limits.

Can Gemini analyze large datasets?

It can assist, but large datasets may benefit from preprocessing, databases, or Python-based aggregation before AI interpretation.

Can Gemini analyze multiple Excel worksheets?

It can work with supported workbooks, but complex multi-sheet analysis should be verified carefully. Feature behavior can vary across interfaces.

Is Gemini better than Excel for data analysis?

They serve different purposes. Excel is a spreadsheet calculation and editing tool; Gemini helps interpret information and generate explanations.

Can Gemini generate Excel formulas?

Yes. Gemini can help generate and explain Excel or Google Sheets formulas.

Can Gemini create pivot tables?

Gemini in Google Sheets supports creating and editing pivot tables through supported workflows.

Can Gemini generate dashboards?

Yes. Gemini can help design dashboards and, in eligible Sheets workflows, create interactive spreadsheet experiences.

Can Gemini analyze financial reports?

Yes. However, important financial calculations, definitions, and conclusions require independent verification.

Can Gemini detect anomalies?

It can identify potentially unusual data patterns, but anomaly detection should use appropriate definitions and validation.

Can Gemini analyze customer data?

Yes, subject to applicable authorization, privacy requirements, and product data-handling terms.

Can I use Gemini with Python?

Yes. Python and the Gemini API can be combined for automated data analysis and reporting.

Can Gemini directly analyze Excel files through the API?

Do not assume the developer API handles Excel workbooks in the same way as the Gemini application. A reliable approach is to use Python to read and process the workbook, then submit relevant structured data or summaries to Gemini.

Does Gemini in Google Sheets require a paid plan?

Some capabilities require eligible Google AI or Workspace plans. Availability and limits depend on the specific feature and account.

Can Gemini generate an XLSX file?

Yes. Google introduced file-generation capabilities supporting Excel and other spreadsheet formats in the Gemini app.

Does Google Sheets use Gemini 4 Neon?

Not necessarily. Google manages the underlying models used in Workspace features separately from public API model identifiers.

Is Gemini data analysis always accurate?

No. Models can misread data, omit records, generate incorrect calculations, or infer unsupported explanations. Verification remains necessary.


Final Thoughts: Should You Use Gemini for Excel and CSV Analysis?

Google Gemini offers a convenient way to explore spreadsheet data without requiring advanced programming skills.

You can upload Excel and CSV files, ask questions, identify patterns, create visualizations, and generate written explanations.

For beginners, this makes data analysis more approachable.

For business professionals, Gemini can help accelerate routine reporting and exploratory investigations.

For developers, the combination of Python, pandas, and the Gemini API provides additional control over validation, calculations, and automation.

However, reliable data analysis requires more than a convincing explanation.

The underlying data must be accurate, calculations must be correct, and conclusions must be supported by evidence.

The most effective approach is to use Excel, Google Sheets, or Python for deterministic data processing—and Gemini for interpretation, explanation, and report generation.

Start with a small dataset.

Verify the results.

Then expand to larger analyses and automated workflows as your requirements become more sophisticated.


Related Articles

  • Article 005: Gemini 4 Neon API: Complete Python Tutorial (2027)
  • Article 006: 25 Practical Gemini 4 Neon Use Cases (2027)
  • Article 008: How to Analyze Large PDFs with Gemini 4 Neon (2027)
  • Article 011: How to Use Gemini for Google Sheets Automation (2027)
  • Article 012: 50 Useful Gemini Prompts for Everyday Work (2027)
  • Article 014: Gemini for Software Developers (2027)
  • Article 017: How to Use Gemini in Google Docs (2027)
  • Article 018: How to Use Gemini in Google Drive (2027)
  • Article 021: Gemini Deep Research (2027)
  • Article 022: Gemini vs NotebookLM (2027)

Official Sources and Further Reading

  1. Google — Attach and Analyze Files in Gemini Apps
  2. Google — Use Gemini Apps
  3. Google Workspace Updates — Create, Preview and Edit Files in Gemini
  4. Google Workspace Updates — Build and Edit Complex Spreadsheets
  5. Google — Collaborate with Gemini in Google Sheets
  6. Google — Build or Edit Entire Spreadsheets with Gemini
  7. Google Workspace Updates — Sheets Canvas
  8. Google Workspace Updates — Generate Files in Gemini
  9. Google — Gemini API Documentation
  10. pandas Documentation
  11. openpyxl Documentation

Editorial methodology: This tutorial is based on official Google Gemini, Google Workspace, and developer documentation reviewed on November 24, 2026. The sales dataset, examples, prompts, and productivity calculations are illustrative. The Python examples have not been independently executed against a live Gemini API account. Spreadsheet features, account eligibility, API support, and billing conditions may change during 2027. Verify the current documentation and validate important calculations before using the workflow for business-critical analysis.

EndpointPilot

Contact

© 2026 EndPointPilot. All rights reserved. Ontworpen door Ben Kemp.

Discover more from EndpointPilot

Subscribe now to keep reading and get access to the full archive.

Continue reading