Build a Smart Google Sheet with Gemini
Clean, analyze, and report sales data with Gemini in Google Sheets.
Introduction
30 Second Summary
Staring at hundreds of rows of messy spreadsheet data and wondering how you will ever make sense of it is exhausting. With Gemini in Google Sheets, you do not need to be a math or spreadsheet wizard to clean up and organize your data in seconds.
In this project, you'll use Gemini in Google Sheets to turn 200 messy sales orders into a clean sheet with a Category column, three charts, and a five-line team summary. It works inside the sheet and fills columns with the AI function, so there's no copying back and forth.
What You'll Build
Gemini works in a side panel beside your sheet. It cleans the data and adds an AI-filled Category column. Then it writes charts and a summary into new tabs.
By the end of this project, you'll have:
- A clean sales tab with 190 orders and a Sales column.
- An AI-filled Category column made with one formula.
- An Analysis tab with three charts and a Summary tab of the trends.
- Secret Mission: Add a new month of sales and refresh the whole sheet.
Are there any prerequisites?
This project is part of the Excel and Google Sheets series. You need:
- Google AI Pro or Ultra, or a Business or Enterprise Workspace plan. Free limits run out partway through.
- Google Sheets with your Google Account set to US English.
- No code, terminal, or AI experience needed.
Before We Start
Before We Start...
With Gemini right inside Sheets, you skip the copy and paste. In this project, you'll clean 200 sales orders, add an AI-filled Category column, and build an Analysis tab and a team summary in the same file.
Open Your Sales Sheet and Gemini
Every smart sales sheet starts with data the AI can read. The sample data comes as an Excel file, which Gemini doesn't handle as well as a Google Sheets file.
You'll import it into Google Sheets, a spreadsheet app that runs online. Then you'll check that Gemini in Google Sheets, the AI assistant beside your sheet, can read it.
In this step, get ready to:
- Create a blank Google Sheet for the sample data.
- Import the messy sales data as Smart Sales Sheet.
- Check that Gemini's reply names the 10 duplicate rows.
Download the Excel file
The Excel file holds the messy sales records you'll clean in this project. Keep it unchanged so your import starts from the same data.
- Download messy-sales.xlsx from the sample repository.
You should see messy-sales.xlsx in your Downloads folder.
- Open Google Sheets.
- Sign in with the Google Account linked to your eligible plan, if asked.
- Select Blank spreadsheet.
You should see an empty spreadsheet named Untitled spreadsheet.
Import the Excel file into your spreadsheet
Importing the Excel file replaces the empty spreadsheet with the sample data. The result is a native Google Sheets file.
- Select File in the top menu.
- Select Import.
- Select Upload.
- Choose the downloaded messy-sales.xlsx file from your device.
- Choose Replace spreadsheet under Import location.
- Select Import data.
You should see a Sales tab with 200 order rows dated January to June 2026.
Why import instead of opening the file directly?
Gemini in Google Sheets works best with native Google Sheets files. Importing with Replace spreadsheet converts the Excel data into that format.
- Select the spreadsheet title in the top-left corner.
- Enter Smart Sales Sheet as the new title.
- Press Enter.
Your spreadsheet is now saved in Google Drive as Smart Sales Sheet.
Reveal the data problems
The Gemini side panel can inspect the active sales data without a separate copy-and-paste workflow. Its first reply gives you a baseline before any cleanup begins.
- Select Ask Gemini at the top right of the spreadsheet.
You should see the Gemini side panel beside the sales data.
- Copy this prompt, which asks Gemini to describe the sheet and spot its problems:
Describe what's in this sheet: the columns, the date range, how many rows there are, and any data problems you can see.
What does this prompt ask?
- The column request checks whether Gemini understands the table's structure.
- The date request establishes the reporting period.
- The row count gives you a baseline before duplicate removal.
- The final request surfaces visible issues such as duplicates or blank cells.
- Paste the prompt into the Ask Gemini box at the bottom of the side panel.
- Press Enter.
- Read Gemini's reply.
- Compare its row count and dates with your sheet.
- Look for at least one named problem, such as duplicate rows or blank cells.
Gemini's wording and order can vary. It should still describe about 200 rows from January through June 2026.
It should also name a data problem, such as the 10 duplicate rows.
Gemini cannot see the sales data?
- Select the Sales tab.
- Send the prompt again.
- Confirm the spreadsheet title is Smart Sales Sheet.
- Reimport messy-sales.xlsx with Replace spreadsheet if the sales rows are missing.
Help me troubleshoot why Gemini cannot describe my imported sales data.
Your spreadsheet is ready. Next, you will review Gemini's cleanup plan before letting it change the data.
Clean the Sales Data
Your first review exposed the problems hiding in the imported sales data. Now you can turn those clues into a dependable sales table.
Duplicates, mixed dates, and blank cells make the totals unreliable. Gemini in Google Sheets can fix them in one pass, as long as you check its plan first.
In this step, get ready to:
- Get a cleanup plan from Gemini for every data problem.
- Review and approve the plan.
- Verify 190 orders and a $26,261 total.
Ask Gemini to propose the cleanup
A precise cleanup request gives Gemini a checklist for the entire Sales tab. Requiring a plan gives you a chance to catch an omitted rule before the data changes.
- Copy this prompt, which asks Gemini to plan every fix before it changes anything:
Clean this sheet. Remove exact duplicate rows, turn every Order Date into a real date, turn every Quantity into a number, 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, and add a Sales column that equals Quantity times Unit Price. Tell me what you will change before you change it.
What does this prompt do?
- The request groups every cleanup rule into one reviewed action.
- The matching-product rule gives Gemini a basis for filling each blank Unit Price value.
- The final rule defines Sales as Quantity multiplied by Unit Price.
- The last sentence requires a plan before any changes are applied.
- Select the Ask Gemini box in the side panel.
- Paste the copied prompt.
- Press Enter.
Gemini should reply with a plan and an Approve button. This can take up to 3 minutes.
Cleanup didn't finish?
- If you see Something went wrong, send the cleanup prompt again. The failed plan can't be approved twice.
- If Gemini replies with steps instead, follow them in order.
Ask for help applying Gemini's cleanup instructions to this Sales tab.
Review the cleanup plan
Gemini can change many cells at once, so read the plan before it runs. Its wording and order can vary, but it must cover every rule in your prompt.
- Select More under Steps, if you see it.
- Select the arrow beside each step to read its details.
- Compare the steps with every rule in your prompt.
- Check that the plan adds Sales as column G.
- Select Approve beneath the plan.
Why review every rule?
A plan can look complete while missing one small request. Comparing it with the prompt protects the row count plus every calculation that follows.
Cleanup can take up to 10 minutes while Gemini works through each column. When it finishes, you should see tidy values and a new Sales column.
Verify every cleanup result
A clean-looking table can still contain a missed duplicate or an incorrect formula. These checks test the row count plus the fixed values before you trust the total.
- Scroll to the bottom of the Sales tab.
You should see the last order, SO-1190, on row 191.
- Select any cell in the sheet.
- Press Cmd+F (macOS) or Ctrl+F (Windows).
- Enter SO-1047 in the search box.
You should see 1 of 1, so the duplicate is gone.
- Replace the search text with Unknown.
You should see 1 of 4, one match for each blank Region that Gemini filled.
- Press Esc to close the search.
- Check that Sales is the header in column G.
Each value in column G should equal Quantity multiplied by Unit Price for that order.
- Select cell J191, beside the last order.
- Enter this formula to add up all 190 orders:
=SUM(G2:G191)
What does this formula do?
- SUM adds every value in the range.
- G2:G191 runs from row 2, the first cleaned order, to row 191, the last.
- One total tests all 190 orders at once.
- Widen column J if the total is cut off.
You should see $26,261.00.
Total isn't $26,261?
- Send this prompt to find the problem:
The Sales column should total $26,261 across 190 orders. Check for duplicate rows, blank or text values in Quantity and Unit Price, and Sales formulas that don't equal Quantity times Unit Price. Tell me what you will fix before you change it.
Help me find why my sales total is wrong.
That's the reliability check done: your cleaned sales data now produces the verified total.
Next, you will use the AI function to give every cleaned product a reporting category.
Categorize Products with AI
Your Google Sheets Sales tab now has 190 trustworthy orders. Your team will want to compare types of product, but the sheet only lists product names.
The AI function, a formula that has AI write text in a cell, turns each product name into a category.
In this step, get ready to:
- Write an AI formula that categorizes the first product.
- Generate all 190 categories in column H.
- Verify a category for each type of product.
Create the first category
The AI function only sees the cell or range supplied as context. This formula passes the product in C2 so the result stays tied to the current order.
- Select cell H1.
- Type Category.
- Select cell H2.
- Paste this formula, which asks AI to label the product in C2:
=AI("Classify this product as Accessory, Display, or Audio. Reply with one word only.", C2)
What does this formula do?
- The prompt limits the result to Accessory, Display, or Audio.
- The C2 reference supplies the product from the current row as context.
- The one-word instruction keeps the Category column consistent.
- On your own data, a cell like ERROR gets a sentence instead of a category, and a blank cell doesn't generate. Add or Unknown to the prompt's list to catch them.
- Press Enter.
- Select Generate and Insert if it appears.
- Close the Suggested autofill box if it appears.
You should see Accessory in H2, because C2 holds Laptop Stand. AI output can vary, but this one-word prompt should still give Accessory.
Generate and review every category
Each copied formula uses the Product cell from its own row. This gives every order an independent classification.
Generating 190 cells stays under the 350-cell batch limit. Generated text can't be undone.
- Select the Name box to the left of the formula bar.
- Enter H2:H191.
- Press Enter to select the range.
- Press Cmd+D (macOS) or Ctrl+D (Windows) to copy the formula down.
- Select Generate and Insert if it appears.
- Select Retry beside the formula bar if any cells show Something went wrong. Try again.
Cells fill a few at a time. You should see Accessory, Display, or Audio in every cell from H2 to H191.
Missing category results?
- Confirm cell H2 still contains the AI formula before you copy it down.
- Select the range H2:H191 again.
- If you see You've reached your monthly limit for AI function in Sheets, stop here and continue once your monthly allowance resets.
Help me fix missing AI categories in Google Sheets.
Verify the categories
- Find a 27-inch Monitor row.
- Find a Noise-Cancelling Headphones row.
- Compare their categories with the other products.
The 27-inch Monitor rows should show Display.
The Noise-Cancelling Headphones rows should show Audio, and the other four products Accessory. Regenerate any cell that shows something else.
A category looks wrong?
- Select the cell with the wrong category.
- Select the refresh icon beside it to generate it again.
Help me fix a wrong AI category.
Your 190 cleaned orders now have reporting categories that are ready for comparison. Next up, you will turn those rows into summary tables and charts.
Analyze Sales Trends
Your cleaned Google Sheets spreadsheet now has reviewed categories for all 190 orders. The next goal is to turn those rows into trends your team can read quickly.
A clean table is hard to scan, so Gemini in Google Sheets will turn the rows into a visual analysis.
In this step, get ready to:
- Build an Analysis tab with three summary tables and three charts.
- Add a note naming the fastest-growing region.
- Verify that June leads monthly sales at $5,491.
Define the analysis outputs
Gemini can group the same sales data in several ways. Asking for specific summary tables and chart types gives each business question a matching view.
- Select cell A1 on the Sales tab.
- Return to the Ask Gemini side panel on the right.
- Send this prompt to build the Analysis tab:
Analyze sales by month, region, and product. On a new tab called Analysis, add summary tables and three charts: monthly sales as a line chart, total sales by region as a bar chart, and the top 5 products by total sales as a bar chart.
What does this prompt do?
- The first sentence asks Gemini to group sales by three business dimensions.
- The second sentence assigns a chart type to each requested comparison.
- The top-products chart limits the result to five products so the ranking stays readable.
- Read Gemini's plan.
- Check that it includes an Analysis tab, three summary tables, and three charts.
- Select Approve.
Building the tab can take up to 10 minutes. When it finishes, select the Analysis tab: you should see three summary tables, one line chart, and two bar charts.
Missing an Analysis output?
- Follow Gemini's steps if it replied with instructions instead of editing.
- Send the prompt below if Gemini asks whether to proceed and shows no Approve button. Don't reply yes.
- Confirm that the analysis uses the Sales tab with all 190 orders.
- Send the prompt below to add anything missing.
Check the Analysis tab and add anything missing: summary tables of sales by month, region, and product, a line chart of monthly sales, a bar chart of total sales by region, and a bar chart of the top 5 products by total sales. Use all 190 orders on the Sales tab. Show me the plan first.
Help me fix a missing table or chart in my Analysis tab.
Compare regional growth
Regional totals show the size of each market. Comparing January with June reveals which region gained momentum fastest.
- Add the regional growth finding by sending this follow-up prompt:
Excluding Unknown, which region grew fastest by percentage from January to June 2026, and by how much? Add the answer as a short note on the Analysis tab.
What does this follow-up do?
- The prompt compares the same regions at two points in time.
- The requested note keeps the growth finding beside the charts that support it.
- Read Gemini's reply.
- Check that it adds a short note to Analysis.
- Select Approve if Gemini shows a plan.
You should see a note on the Analysis tab naming West, up from $355 in January to $1,698 in June.
Verify the trends
- Select the Analysis tab.
- Find the highest month in the monthly table.
- Read the regional growth note.
You should see three summary tables plus three charts. The monthly results should place June highest at $5,491.
The note should show West rising from $355 in January to $1,698 in June.
The note doesn't name West?
- Send this prompt:
Recalculate each region's percentage change from January to June 2026 from the Sales tab, excluding Unknown. Correct the growth note on the Analysis tab to name the region with the biggest increase.
Help me check which region grew fastest.
Gemini may arrange the tables and charts differently. The fixed figures are your source of truth.
That is the analysis working: your 190 orders now reveal the strongest month plus the fastest-growing region.
Your spreadsheet now turns cleaned rows into clear sales findings. Next, you will shape those findings into a short update for your team.
Create a Team Summary
That is the analysis finished: your Analysis tab now has three charts with verified June and West findings.
Charts support exploration. Your team also needs a short explanation of what changed and what deserves attention.
In this step, get ready to:
- Create a Summary tab with five lines.
- Check that each line matches Analysis.
- Rewrite at least one line so it sounds like you.
Ask Gemini for five lines
Gemini in Google Sheets can turn the findings in Analysis into a short update. Naming each topic keeps the response focused on the facts your team needs.
- Switch back to the Ask Gemini side panel from earlier.
- Select the prompt field at the bottom of the panel.
- Generate the team summary by sending this exact prompt:
Create a new tab called Summary. Write a five-line summary of the sales trends for my team, based on the Analysis tab: total sales, the monthly trend, the top product, the fastest-growing region, and one thing to watch. Use plain English.
What does this prompt ask for?
- The prompt uses Analysis as the source for the summary.
- The five named topics give each line a clear purpose.
- The plain-English instruction keeps the result readable for a team update.
- Read Gemini's proposed plan.
- Check that the plan creates a Summary tab with all five requested topics.
- Select Approve once all five topics are covered.
This can take a few minutes. When it finishes, you should see a new Summary tab with five plain-English lines. Gemini's wording can vary, but the numbers must match Analysis.
No Summary tab yet?
- Follow the instructions Gemini provides if it responds with steps instead of editing the sheet.
- Confirm that the finished tab contains five lines after following those steps.
- Send the prompt below if one of the five topics is missing.
Update the Summary tab so it has five plain-English lines based on the Analysis tab: total sales, the monthly trend, the top product, the fastest-growing region excluding Unknown, and one thing to watch. Show me the plan first.
Help me create the five-line Summary tab from my Analysis findings.
Check the summary against Analysis
Generated summaries still need a fact check. The Analysis tab is your evidence for deciding whether each line is accurate.
- Read all five summary lines.
- Compare each line with the findings in Analysis.
The total-sales line should show $26,261.
The monthly-trend line should identify June as the best month at $5,491.
The top-product line should identify 27-inch Monitor.
The fastest-growing-region line should identify West. It should agree with the increase from $355 in January to $1,698 in June.
The final line should name one item to watch that agrees with the analysis, such as the 4 Unknown-region orders worth $931.
A line doesn't match Analysis?
- Send this prompt:
Compare each line on the Summary tab with the Analysis tab. Correct any number, month, product, or region that doesn't match, and keep it to five lines.
Help me check my summary.
Rewrite one line in your voice
A team update works best when it sounds like the person sharing it. You can change the wording while keeping the verified finding intact.
- Double-click one line on the Summary tab.
- Rewrite it in your own words without changing its numbers.
- Press Enter.
You should still see five lines in Summary, with at least one in your own words and its numbers unchanged.
Secret mission
Add July and Refresh the Sheet
Monthly reporting only works when the next batch can join the same workbook. Add 39 July orders. Then use Gemini to refresh Category, Analysis, and Summary for 229 orders totaling $32,265.
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. This project adds no usage charge, but a Google AI Pro plan renews every month until you cancel it.
Resources you used:
- The Google Sheets spreadsheet named Smart Sales Sheet in Google Drive.
- The downloaded messy-sales.xlsx file on your device.
- The downloaded july-sales.xlsx file, if you did the Secret Mission.
- A Google AI Pro plan, if you subscribed for this project.
✔️ Keep everything running
No action needed. Choose this if you want to keep updating the sheet with each new month.
- Keep Smart Sales Sheet in Google Drive for future sales updates.
- Keep messy-sales.xlsx as a fresh copy of the original messy data.
- Keep july-sales.xlsx as the source for the July orders.
✋ Pause - I'll come back to this later
Nothing needs shutting down. Close the sheet, and keep your files so you can pick up where you left off.
- Close Smart Sales Sheet.
Your spreadsheet stays saved in Google Drive. You can return to it later from the same account.
ⓧ Delete - I don't want to use this again
Remove all project resources and start fresh if you ever want to rebuild.
- Open Smart Sales Sheet.
- Select File.
- Select Move to trash.
- Check that it's listed under Trash in Google Drive.
Your two downloaded source files remain on your device until you remove them separately.
- Delete messy-sales.xlsx from your Downloads folder.
- Delete july-sales.xlsx from your Downloads folder, if you downloaded it.
- Open Google One if you subscribed to Google AI Pro only for this project.
- Select Settings.
- Select Cancel membership and confirm.
You keep Google AI Pro until the end of your billing cycle.
Nice Work!
Nice Work!
You cleaned, categorized, and summarized 190 sales orders with Gemini in Google Sheets, without copying a single cell into a chat. That's the fourth project in the Excel and Google Sheets series done.
You've learned how to:
- Clean a messy sheet with Gemini and check its plan before approving it.
- Fill a column with the AI function.
- Turn clean data into charts and a plain-English team summary.
- Secret Mission: Add a new month of sales and refresh the whole sheet.
Reach for Gemini in Google Sheets when the data you need to work on already lives in a sheet.
Ready to quiz yourself?