Sub topic 4
Writing Prompts That Name Ranges and Outcomes
Assume you know how to select cells and ranges in Google Sheets, use simple formulas such as SUM and IF, and open the Gemini side panel. Gemini works best when your sheet has clear headers, one record per row, and consistent data types.
A prompt is an instruction written in ordinary language. In Sheets, an effective prompt tells Gemini:
- What data to use
- Where that data is located
- What operation to perform
- What the result should look like
- How to handle empty or unusual values
Start with the data layout
Before writing a prompt, inspect the sheet. Identify the header row and the columns that matter. For example, a monthly-expenses sheet might use this layout:
| Column | Header | Example value |
|---|---|---|
| A | Date | 2026-01-05 |
| B | Category | Groceries |
| C | Description | Weekly shopping |
| D | Amount | 84.50 |
| E | Paid By | Alex |
The range A1:E50 includes the headers and up to 49 expense records. Naming this range gives Gemini a clear boundary. Naming only “my expenses” leaves more room for misunderstanding.
Name the operation and the outcome
Compare these prompts:
Make a summary of my expenses.Using A1:E50, create a summary table that groups rows by Category in column B and adds the Amount from column D for each category. Include the category name and total amount, and label the second column Total Amount.The second prompt identifies the source range, grouping column, calculation column, and desired output columns. Those details make the result easier to check and revise.
For a new table, describe every required column:
Create a table to track monthly expenses with columns Date, Category, Description, Amount, and Paid By.For a formula, state the destination, source, calculation, and edge case:
In column F, add a formula that shows the Amount from column D plus 10% tax, and leave the cell blank when column D is empty.A prompt can also specify formatting without confusing it with the calculation:
Format the Total Amount column as currency, keep the header row bold, and do not change the source data.Use a prompt structure
A reusable structure is:
- Action: Create, calculate, explain, summarize, or chart.
- Source: Name the sheet and range, such as
Expenses!A1:E50. - Fields: Identify columns by header and letter.
- Rules: State filters, grouping, sorting, and empty-cell behavior.
- Output: Describe the location, columns, labels, or chart title.
Make ambiguity explicit
Gemini may interpret unclear terms differently from you. Replace “recent” with a date rule. Replace “large expenses” with a threshold. Say whether tax is included and whether blank amounts should be ignored.
For example:
In Expenses!A1:E200, create a table of categories whose total Amount exceeds 500. Group by Category, sum column D, sort from highest to lowest total, and label the result Category and Total Amount. Ignore rows where Amount is blank.You can ask Gemini to explain its interpretation before applying a result:
Explain the steps and formula you would use for this request. Do not modify the sheet yet.This is useful when the result affects financial, operational, or shared data.
Refine with follow-up prompts
You do not need to write one perfect prompt. After Gemini produces a result, give a focused correction:
Keep the same source range, but group by Paid By instead of Category. Rename the total column Spending and sort it descending.Manual edits are also part of the workflow. Review inserted headers, formulas, labels, and ranges before sharing the sheet. If Gemini uses the wrong range, state the exact replacement rather than asking it to “fix the table.”
Exercise
Write a prompt that creates a column chart of total Amount by Category from Expenses!A1:E100, titles it “Spending by Category,” and ignores blank Amount cells.
Show answer
Create a column chart of total Amount by Category using Expenses!A1:E100. Group by Category in column B, sum Amount in column D, ignore rows with blank Amount cells, and use the title “Spending by Category.”