Analyze Google Sheets Data with Gemini

Clean, analyze, and chart sales data in Google Sheets with free Gemini.

Introduction

30 Second Summary

If you use Google Sheets manually, cleaning a messy table can mean checking hundreds of cells one by one. One missed duplicate or inconsistent name can change your totals.

In this project, you will use the free Gemini app, Google's AI assistant, to clean a messy sales spreadsheet in Google Sheets. You'll prove its answers with formulas, chart sales by region, and write a five-line summary, all without paying anything.

What You'll Build

Gemini reads an export of your spreadsheet and returns clean data, which you paste into a new tab and check with formulas, a pivot table chart, and a Region slicer.

By the end of this project, you'll have:

  • A Clean tab of 190 orders with no duplicates, one name per product, and real dates, plus a Sales column that adds up.
  • Formula checks that prove Gemini's answers.
  • A monthly sales chart you can filter by region.
  • Secret Mission: The same check-first workflow on a spreadsheet of your own.

Are there any prerequisites?

This is the second project in the Excel and Google Sheets series:

Before We Start

Gemini in Google Sheets runs out fast without a paid plan, but the free Gemini app can still read your spreadsheet. You get clean data, checked answers, and a chart without paying anything.

Import the Messy Sales Data

Every trustworthy analysis starts with knowing what's wrong with the data. You'll import a messy Excel file into Google Sheets and find its problems before you trust any totals from Gemini.

Your imported Sales tab stays untouched. That baseline lets you compare every later change with the source.

In this step, get ready to:
  • Download the messy-sales.xlsx Excel file.
  • Import it into a spreadsheet named Sales Analysis.
  • Spot the problems in its 200 orders.
Download the Excel file

You should see messy-sales.xlsx in your Downloads folder.

Import the Excel file into a spreadsheet

Importing the Excel file turns it into a native Google Sheets spreadsheet. You can inspect every cell while the imported tab stays as your baseline.

  • Go to Google Sheets.
  • Sign in to your Google Account, if asked.
  • Select Blank spreadsheet.

You should see an empty cell grid in a new spreadsheet.

  • Select File in the top menu.
  • Select Import.
  • Select Upload.
  • Choose the downloaded messy-sales.xlsx file.
  • Choose Replace spreadsheet under Import location.
  • Select Import data.

You should see a Sales tab filled with the order rows.

Sales rows not appearing after import?

  • Check that the downloaded filename is messy-sales.xlsx.
  • Repeat the import with Replace spreadsheet selected.

Help me import the Excel file into Google Sheets.

  • Select the current spreadsheet name in the top-left corner.
  • Enter Sales Analysis.
  • Press Enter to save the name.

You should see Sales Analysis as the spreadsheet name.

Inspect the messy data

Visible clues already show why the spreadsheet needs cleaning. Inspecting them now gives you specific issues to check when Gemini reviews the data.

  • Scan the Order Date column for dates on the left of their cells.
  • Compare the Product column for different spellings, such as wireless mouse and Wireless Mouse.
  • Look for blank cells in the Region column.
  • Find order SO-1047, which appears twice in a row.

You should find dates stored as text, which sit on the left, plus mixed product spellings, blank Regions, and duplicate rows. Some cells also hide extra spaces, blank Unit Prices, or quantities stored as text.

  • Return to row 1.
  • Confirm the headers are Order ID, Order Date, Product, Region, Quantity, and Unit Price.
  • Scroll to the final populated order row.

You should see the final order on row 201. That confirms there are 200 order rows beneath the header row.

That's a strong start: your 200 messy orders are now safe in the Sales Analysis spreadsheet.

Next, you'll use Gemini to clean the visible problems while keeping this baseline intact.

Clean Data with Gemini

The original Google Sheets tab now preserves the messy source data. That record lets you compare every cleaned result with the 200 original orders.

The visible data problems make every total unreliable: a quick SUMPRODUCT of Quantity times Unit Price on the Sales tab gives $28,176, which is $1,915 more than the real figure you'll prove in Step 3.

You will use Gemini to identify each problem before asking it to clean the rows. This two-stage approach makes the data cleaning easier to inspect.

In this step, get ready to:
  • Share the messy sales data with Gemini.
  • Get an audit and a cleaned table from Gemini.
  • Paste 190 cleaned orders into a Clean tab.
Share the messy data with Gemini

A CSV, a plain-text copy of a table, carries the rows into Gemini. Your Sales tab stays unchanged.

What is Gemini?

Gemini is Google's AI assistant that you chat with at gemini.google.com. The free app can read files you attach, answer questions about them, and explain formulas and charts, without a paid Google AI plan.

Reach for it when you want help with data you can safely share. Keep private or sensitive data out of the chat.

  • Select the Sales tab.
  • Select File in the top menu.
  • Select Download.
  • Select Comma Separated Values (.csv).

You should see Sales Analysis - Sales.csv in your Downloads folder.

  • Select + beside Ask Gemini.
  • Select Upload files.
  • Choose the CSV from your Downloads folder.

You should see the CSV attached to the empty Gemini chat. Gemini now has the same 200 messy orders that remain in your Sales tab.

Can't attach the CSV?

Use copied cells when the attachment fails or Gemini cannot read the file.

  • Select the Sales tab.
  • Select all cells containing the six headers plus 200 orders.
  • Copy the selected cells.
  • Paste the copied cells into the Gemini prompt box.

Help me share my Google Sheets data with Gemini.

Audit and clean the sales data

The first prompt creates a problem inventory before any values change. You can compare that inventory with the known issues planted in the Excel file.

  • Paste this prompt, which asks Gemini to list every problem before it changes anything, into the Ask Gemini box:
List every data problem you find in this sales spreadsheet. Group them by type, say how many rows each type affects, and give one example row for each. Don't change anything yet.

What does this prompt do?

  • List every data problem asks for a diagnosis before any cleanup.
  • say how many rows each type affects gives you counts to check against the Sales tab.
  • Don't change anything yet keeps the data as it is until you review the list.
  • Press Enter.

This can take about a minute. Gemini should return a grouped review of the problems.

Its wording and row counts can vary, because it may count both copies of a duplicate.

  • Check that the review covers duplicates, date formats, product names, extra spaces, blank Regions, and blank Unit Prices.
  • Check that it finds 10 duplicated orders, 4 blank Regions, and 5 blank Unit Prices.

A complete review covers all six problem types.

A CSV doesn't keep cell types, so Gemini misses the 4 Quantities stored as text. Pasting the clean table turns them into numbers.

The audit gives you a checklist for the repair. The next prompt turns that checklist into explicit cleaning rules.

  • Paste this prompt, which gives Gemini one fix for each problem, into the same chat:
Fix every problem you listed. Remove exact duplicate rows. Turn every Order Date into a date in YYYY-MM-DD format. Use one spelling for each product name. Trim extra spaces. Fill a blank Unit Price with that product's price from other rows. Write Unknown in any blank Region, because it can't be worked out. Add a Sales column that equals Quantity times Unit Price. Explain each change in a short table. Then give me all the cleaned rows as one table with the columns Order ID, Order Date, Product, Region, Quantity, Unit Price, and Sales.

What does this prompt do?

  • Remove exact duplicate rows drops the 10 repeated orders.
  • Fill a blank Unit Price with that product's price from other rows uses prices already in the data.
  • Write Unknown in any blank Region marks Regions the data can't fill.
  • Add a Sales column multiplies Quantity by Unit Price for each order.
  • Press Enter.

This can take up to two minutes. Gemini should return a short table of changes, then every cleaned row in a seven-column table ending in Sales.

Build and verify the Clean tab
  • Select + at the bottom-left of the spreadsheet.
  • Double-click the new tab's name.
  • Enter Clean.
  • Press Enter.

You should see an empty Clean tab beside the Sales tab.

  • Switch back to the Gemini chat.
  • Scroll to the end of the cleaned table.
  • Select ⋯ just beneath the table.
  • Select Copy.
  • Switch back to the Clean tab.
  • Select cell A1.
  • Press Cmd+V (macOS) or Ctrl+V (Windows).

You should see the headers Order ID, Order Date, Product, Region, Quantity, Unit Price, plus Sales across row 1.

  • Scroll to the bottom of the pasted table.
  • Read the row number beside the final cleaned order.

A complete table ends on row 191 because row 1 contains the headers. Rows 2 through 191 contain exactly 190 orders.

Table ends before row 191?

  • Send this prompt in the same chat:
Continue the table from the last row you showed.
  • Copy the new rows, without their header.
  • Paste them into the first empty cell in column A of the Clean tab.

Help me finish the cleaned table.

  • Compare a few cleaned rows with the Sales tab.
  • Check that dates and numbers sit on the right of their cells.
  • Check that order SO-1040 now has Unknown as its Region.

Values on the right are real dates and numbers, so the formulas in the next step can add them up.

That is the cleanup complete. Your 190-row Clean tab is ready for formula checks.

Verify Answers with Formulas

Your cleaned table has 190 consistent orders. The next goal is to prove the headline findings before you present them.

A Google Sheets formula exposes whether each convincing Gemini answer matches the cleaned data.

In this step, get ready to:
  • Ask Gemini for answers with formula checks.
  • Place the formulas beside the cleaned data.
  • Match every result with the known figures.
Ask Gemini for answers and checks

The written answers show Gemini's interpretation of the data. The suggested formulas give you checks that run inside the spreadsheet.

  • Ask Gemini for three answers, each with a formula you can check, by sending this prompt in the same chat:
Using the cleaned data, answer in plain English: 1. What were total sales for January to June 2026? 2. Which product had the highest total sales? 3. Excluding Unknown, which region grew fastest by percentage from January to June 2026? For each answer, give me one Google Sheets formula I can paste into an empty cell on a tab named Clean, where the headers are in row 1 and the data is in A2:G191. Use SUMIFS only with single values, and use QUERY for anything that compares products or regions. Then give me one QUERY formula that lists total sales by product, highest first.

What does this prompt ask for?

  • The three questions establish the claims you need to test.
  • The SUMIFS formulas check results against matching rows.
  • The QUERY formula creates a product ranking from the cleaned table.

Gemini should return three plain-English answers, each with a checking formula, plus one QUERY ranking formula. The formulas can be written differently each time, but each must read columns A to G of the Clean tab.

Place the formulas beside your clean data

The SUMIFS function adds values only from rows that meet the conditions you give it. The QUERY function can group a range into a ranked result.

  • Switch back to Sales Analysis.
  • Select the Clean tab.
  • Paste the total-sales formula into J1.
  • Paste the top-product formula into J2.
  • Paste the fastest-region formula into J3.

You should see 26261 in J1, 27-inch Monitor in J2, and West in J3.

  • Paste the QUERY formula into J5, so its table has room to grow.

You should see a ranking table from J5, with 27-inch Monitor and 6474 on the row under its headers.

Compare every result with the checkpoints
  • Compare the total-sales result with $26,261 for January through June 2026.
  • Check that the top-product result names 27-inch Monitor with $6,474 in sales.
  • Check that the fastest-growing Region is West.
  • Confirm that West rises from $355 in January to $1,698 in June.
  • Confirm that the QUERY ranking lists 27-inch Monitor first.

That is the evidence in place: each headline answer now agrees with the cleaned rows.

A result doesn't match?

  • Check that the formula reads the Clean data in columns A:G.
  • Confirm that the Clean tab still contains exactly 190 order rows.
  • Send this prompt to get corrected formulas:
Recheck all four formulas you gave me. They must work on a Google Sheets tab named Clean with headers in row 1, data in A2:G191, real dates in column B, and numbers in column G. Give me corrected formulas and the result each one should return.
  • To check the product ranking yourself, paste this formula into cell N1:
=QUERY(A1:G191,"select C, sum(G) group by C order by sum(G) desc",1)

Use this if the mismatch continues: Help me diagnose why my Google Sheets formula does not match the checked sales result.

Your key findings now have spreadsheet evidence behind them. Next, you will turn those checked numbers into a monthly chart that can filter by Region.

Create a Filterable Sales Chart

Your 190 rows hold six months of orders, but no row tells you which month sold most. A pivot table in Google Sheets adds them up by month, and a line chart shows the pattern.

To see one region's months, you'd have to filter 190 rows by hand. A Region slicer does it in one click.

In this step, get ready to:
  • Get chart guidance from Gemini.
  • Build a monthly line chart from a pivot table.
  • Filter the chart to West with a Region slicer.
Ask Gemini for chart guidance
  • Switch back to the same Gemini chat.
  • Paste this prompt into the Ask Gemini box:
My cleaned data is on a Google Sheets tab named Clean, with headers in row 1. Which chart type fits monthly sales best, and why? Then give me click-by-click steps to make a pivot table of total Sales by month, a line chart from that pivot table, and a slicer on Region so I can switch regions.

What does this prompt do?

  • tab named Clean, with headers in row 1 tells Gemini where the data lives.
  • Which chart type fits monthly sales best asks it to match the chart to monthly data.
  • click-by-click steps asks for a pivot table, a line chart, and a Region slicer you can follow.
  • Press Enter.

You should receive a chart recommendation plus setup steps. Gemini's steps can vary, so build with the steps below.

Build the monthly pivot and line chart

The cleaned table occupies A1:G191 on the Clean tab. The formula checks begin at J1, so keeping the source range inside column G prevents the checks from entering the pivot table.

  • Select the Clean tab in Sales Analysis.
  • Enter A1:G191 in the Name box at the left of the formula bar.
  • Press Enter to select the orders.
  • Select Insert in the top menu.
  • Select Pivot table.
  • Keep New sheet selected.
  • Select Create.

You should see a new Pivot Table 1 tab with the Pivot table editor open on the right.

  • Select Add beside Rows.
  • Select Order Date - Month.
  • Select Add beside Values.
  • Select Sales.
  • Check that Summarize by shows SUM.

You should see one row for each month from January through June. June should have the highest total at $5,491.

No Order Date - Month option?

  • Check that the dates on the Clean tab sit on the right of their cells. Dates on the left are text.

Help me turn text into real dates.

  • Enter A1:B7 in the Name box, which leaves out the Grand Total.
  • Press Enter.
  • Select Insert in the top menu.
  • Select Chart.
  • Select the Chart type menu under Setup.
  • Select the first chart under Line.

You should see a line covering January through June. Its highest point should be June at $5,491.

Why use a line chart?

The months form an ordered sequence. Connecting their sales totals makes the direction of change visible from one month to the next.

Add the Region slicer and test both views

The slicer applies a Region filter to the analysis while preserving the cleaned table. This gives you a fast way to compare one region with the full sales pattern.

  • Close the chart editor.
  • Select any cell in the pivot table.
  • Select Data in the top menu.
  • Select Add a slicer.
  • Select Region under Column.

You should see a Region slicer on top of the chart. The line chart should remain connected to the monthly pivot table.

  • Drag the slicer to the side so it doesn't cover the line.
  • Select All on the Region slicer.
  • Select Clear.
  • Select West, scrolling the list if needed.
  • Select OK.

You should see West rise from $355 in January to $1,698 in June, with a peak of $1,971 in May.

Does the chart ignore the slicer?

  • Select the slicer to inspect its source.
  • Set the slicer's source to Clean!A1:G191 if it points somewhere else.
  • Set the slicer's Column to Region.
  • Check that Apply to pivot tables is ticked.

Ask for help with a slicer that is not changing the pivot chart.

  • Select 1 of 5 on the Region slicer.
  • Select Select all 5.
  • Select OK.

You should see June return as the highest month at $5,491.

That's the visual proof in place. You can now move between the full monthly trend and West without changing the cleaned data.

Your filterable sales chart is ready. Next, you'll turn the checked findings into a five-line summary that someone can understand without opening the formulas.

Write a Shareable Summary

Your formula checks and filterable chart now prove the sales findings. The next goal is a short summary that someone can understand without opening the analysis.

A cell that says 6474 means nothing to someone who hasn't seen your formulas. A plain-English summary in Google Sheets says what each number is.

The draft provides a starting structure. Your checks protect the numbers while your rewrite gives one finding your own voice.

In this step, get ready to:
  • Ask Gemini for exactly five plain-English findings.
  • Create a Summary tab containing the five findings.
  • Check every finding against your formulas and chart.
Ask Gemini for five plain-English lines
  • Switch back to the same Gemini chat.
  • Paste this prompt into the Ask Gemini box:
Write a five-line summary of the key findings: total sales, the monthly trend, the top product, the fastest-growing region, and one thing to watch. Use plain English and no jargon.

What does this prompt do?

  • The five requested topics give each line one clear job.
  • Plain English keeps the findings understandable outside the spreadsheet.
  • Press Enter.

Gemini should return five separate lines. The wording can vary, but each number must match your checked results.

Didn't get exactly five lines?

  • Send this prompt in the same chat:
Rewrite that summary as exactly five separate lines, one each for total sales, the monthly trend, the top product, the fastest-growing region excluding Unknown, and one thing to watch. No bullets or headings.

Ask for help refining the output with Help me turn this response into exactly five separate summary lines.

Create the Summary tab

A dedicated tab keeps the findings separate from the detailed calculations. It becomes the page you can show without exposing the full working sheet.

  • Select + at the bottom-left of the spreadsheet.

You should see a new blank tab beside the existing tabs.

  • Double-click the new tab's name.
  • Enter Summary.
  • Press Enter.

The tab label should now read Summary.

  • Return to the Gemini chat from earlier.
  • Select only the five summary lines.
  • Copy the selected text.
  • Switch back to the Summary tab.
  • Select cell A1.
  • Paste the copied lines.

You should see five findings beginning at A1. Each finding should occupy its own row.

Check and rewrite the summary

The checked cells and chart are your source of truth. Every summary claim must agree with that evidence.

  • Compare the total-sales line with the checked result of $26,261.
  • Compare the top-product line with 27-inch Monitor at $6,474.
  • Compare the fastest-growing-region line with West rising from $355 in January to $1,698 in June.

These three summary lines should agree with the formula checks beginning at J1.

  • Select the Pivot Table 1 tab.
  • Clear any Region filter in the existing slicer.
  • Compare the monthly-trend line with June as the highest month at $5,491.
  • Select West in the Region slicer.
  • Compare the regional-growth line with the West values for January and June.

The chart should support both the monthly-trend line and the regional-growth line.

  • Check the item-to-watch line against the cleaned data, formula checks, pivot table, or chart.
  • Revise the item-to-watch line if the evidence does not support it.

The item to watch should point to something visible in your analysis.

  • Return to the Summary tab.
  • Choose one of the five lines.
  • Rewrite the chosen line in your own words without changing its checked meaning or numbers.

You should now see at least one line written in your own voice.

You should find five filled rows in column A. If blank rows sit between them, right-click each blank row number and select Delete row.

That completes the communication layer of your analysis. Your checked findings now fit on one five-line page that is ready to share.

Secret mission

Check Gemini on Your Own Data

Take the checked workflow beyond the prepared sales workbook. Use a privacy-safe personal spreadsheet with Gemini. Verify its first answer with a Google Sheets formula.

Clean Up Your Resources

Clean Up Your Resources

Decide whether to keep your resources running, pause them to come back later, or delete them entirely. Your Google Sheets files and Gemini chats cost $0 in this project.

Resources you used:

  • The Sales Analysis spreadsheet.
  • A privacy-safe personal spreadsheet copy, if you created one for the Secret Mission.
  • Two Gemini chats covering the sales analysis and the privacy-safe personal spreadsheet.
  • The downloaded messy-sales.xlsx Excel file.
  • A CSV export of the messy sales data, unless you used the copy-and-paste fallback.
  • Any additional privacy-safe files created for Secret Mission sharing.

✔️ Keep everything running

No action needed. Choose this if you want to revisit your analysis or update it with new data.

  • Keep Sales Analysis in Google Sheets.
  • Keep the privacy-safe personal spreadsheet copy if you made one for the Secret Mission.
  • Leave both Gemini chats in your conversation history.
  • Store messy-sales.xlsx in its current download location.
  • Store the CSV export in its current location if you downloaded one.
  • Keep any additional privacy-safe Secret Mission files in their current locations.

✋ Pause - I'll come back to this later

Nothing needs shutting down. Close what you have open, and keep your files and chats so you can pick up where you left off.

  • Close Sales Analysis.
  • Close Gemini.
  • Reopen the sheet and either chat from your history when you're ready.

ⓧ Delete - I don't want to use this again

Remove all project resources and start fresh if you ever want to rebuild.

  • Open Sales Analysis.
  • Select File.
  • Select Move to trash.
  • Repeat for the privacy-safe copy, if you made one.
  • Open Google Drive.
  • Select Trash in the left sidebar.
  • Check that Sales Analysis is listed.

Google Drive deletes files in Trash for good after 30 days.

The two Gemini chats still hold the project conversation history.

  • In Gemini's sidebar, find the sales analysis chat.
  • Select ⋮ beside the chat.
  • Select Delete.
  • Select Delete again to confirm.
  • Repeat for the Secret Mission chat, if you made one.

The remaining project files are stored on your device.

  • Delete messy-sales.xlsx from your Downloads folder.
  • Delete Sales Analysis - Sales.csv from your Downloads folder.
  • Delete any privacy-safe files you downloaded.

Nice Work!

Nice Work!

You cleared the duplicates, mixed names, and text dates out of 200 orders with the free Gemini app, then proved every total with Google Sheets formulas. That's the third project in the Excel and Google Sheets series done.

You've learned how to:

  • Clean a messy sheet with the free Gemini app and check the result.
  • Prove AI answers with SUMIFS and QUERY formulas.
  • Turn clean data into a pivot table chart with a slicer and a plain-English summary.
  • Secret Mission: Run the same check-first workflow on a spreadsheet of your own.

Reach for the free Gemini app when you can safely share the data and can check its answers in the sheet.

Ready to quiz yourself?