Sub topic 12
Refining with follow-up prompts and manual edits
Gemini's first answer is rarely the final one. This chapter covers how to improve a result in the side panel with follow-up prompts, when to stop prompting and edit by hand, and the errors that make iteration go in circles.
Prerequisites
This chapter assumes you can already do the following:
- Open the Gemini side panel and send a prompt.
- Write a prompt that names columns and ranges.
- Read a formula before applying it, and check it against a small test case.
If any of these is shaky, review the earlier chapters on prompt design and verification first.
Why the first answer is a draft
Gemini works from the prompt, the sheet contents it can see, and the conversation so far. A prompt that is vague about a column, a range, or an edge case gets a reasonable guess. Sometimes the guess is wrong. The fix is usually a small, targeted change, not a rewrite of the whole request.
Treat each round as a loop:
- Send a prompt.
- Inspect the result against your data.
- Decide what is wrong and whether to fix it with a prompt or by hand.
- Repeat until the result passes your check.
Writing a good follow-up prompt
A follow-up works best when it states what to keep and what to change. "Make it better" gives Gemini nothing to act on. Compare these.
| Weak follow-up | Stronger follow-up |
|---|---|
| That's wrong. | The formula in F2 counts blank rows. Change it so F stays empty when column D is empty. |
| Fix the chart. | Change the chart to a column chart, keep the same data range, and sort the bars from highest to lowest. |
| Add more columns. | Add a column named Receipt Link after Paid By. Keep the existing columns unchanged. |
Four habits make follow-ups reliable:
- Name the thing you are changing. Use a cell, column header, range, or chart title.
- Describe the symptom. Say what you see, for example "the total for Groceries is 0".
- State what must stay the same. This lowers the chance that Gemini rebuilds something that already works.
- Change one thing per prompt. If three changes go wrong together, you cannot tell which instruction caused which problem.
Example: refining a formula
Suppose your first prompt was:
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.Gemini returns a formula for F2 that works for filled rows. When you fill it down, you notice it also shows 0 for the empty rows below your data. A useful follow-up is:
Rows 52 to 100 in column F show 0 even though column D is empty. Change the formula so those cells stay blank.A symptom with exact row numbers lets Gemini locate the cause. Compare that with "it doesn't work".
If you want one formula to fill the whole column instead of one per row, ask for it directly:
Replace the formulas in F2:F100 with a single formula in F2 that fills the whole column and leaves blank rows empty.A typical result looks like this:
=ARRAYFORMULA(IF(D2:D="", "", D2:D*1.1))Before applying it, check one detail. An array formula in F2 fills the cells below it, so any value already sitting in F3:F100 blocks it and produces a #REF! error. Clear the old column contents first.
Example: refining a summary
A first prompt might ask for total spending per category. Gemini may return a SUMIF for one category when you wanted a grouped table. Your follow-up should say so:
Instead of one SUMIF, give me a single table with one row per Category and its total Amount. Use the data in A1:E, treat row 1 as headers, and ignore rows where Amount is empty.That points Gemini toward a formula such as:
=QUERY(A1:E, "select B, sum(D) where D is not null group by B label sum(D) 'Total'", 1)The 1 at the end tells QUERY that row 1 holds headers. If your headers span two rows, this argument is wrong, and you must say so in the prompt or change it yourself.
Refining charts
Chart follow-ups usually concern one of four properties: type, series, labels, or range. Name the property in the prompt.
- Type: "Change this to a bar chart."
- Series: "Plot only the Amount column, not the Date column."
- Labels: "Set the title to Spending by Category and label the vertical axis Amount."
- Range: "Use A1:E50 so new rows are included."
If Gemini keeps making the wrong choice for series, edit the chart directly. Open the chart editor, then use the Setup and Customize tabs to change the type, the data range, the series, the axis titles, and the colors. That is faster than a third round of prompting for a fix you can make in a few clicks.
When to edit by hand
Prompting is not always the shorter path. Choose a manual edit when:
- The change is a single cell, label, or number format.
- You already know the exact formula or setting you want.
- Gemini has made the same mistake twice after clear instructions.
- The result is correct except for a detail of appearance, such as column width, color, or font.
Choose another prompt when:
- The change affects many cells or a whole structure, such as adding three columns with formulas.
- You are unsure which function fits the task.
- You want an explanation of what a formula does before you decide.
You can also combine the two. Let Gemini produce the structure, then correct details yourself. If you edit by hand and then continue prompting, tell Gemini what changed, for example "I renamed column C to Type. Use that name from now on". The panel may not reflect every manual change you make, so stating it prevents mismatches.
Undoing and keeping versions
Iteration can damage a sheet that was fine before. Protect your work in three ways.
- Use undo. After Gemini applies a change, Ctrl+Z (or Cmd+Z on Mac) reverses it in most cases. Check the sheet afterward to confirm that the whole change was reversed.
- Work on a copy. Before a large change, use File > Make a copy, or test on a duplicate tab.
- Check version history. Use File > Version history > See version history to return to an earlier state if undo is no longer enough.
Common errors in iteration
| Problem | Likely cause | What to do |
|---|---|---|
| The same wrong result keeps returning. | The prompt repeats the same ambiguity. | Add the missing detail, such as the exact range, column, or edge case. |
| A new change breaks an earlier fix. | The follow-up did not say what to keep. | Restate the earlier requirement, or fix the new problem by hand. |
| `#REF!` after applying an array formula. | Cells below the formula are not empty. | Clear the target range, then reapply. |
| Text numbers do not add up. | Amounts were stored as text, so sums skip them. | Convert the column to numbers, then ask again. |
| Gemini refers to a column that does not exist. | The header name is ambiguous or was changed. | Give the exact header text and the column letter. |
| Results differ after you add rows. | The range was fixed, such as `D2:D50`. | Ask for an open-ended range such as `D2:D`. |
Know when to stop
Stop prompting when the result passes the check you defined in the verification chapter: it matches a manual calculation or a small test case, and it handles the blank and edge rows. More rounds after that tend to add risk without adding value.
Also stop and reconsider when three or four follow-ups have not converged. Long conversations accumulate instructions that can conflict. Start a fresh request that restates the complete goal in one prompt, including everything you learned along the way. A single, precise prompt usually beats a long chain of patches.
A worked iteration
Here is a short session with three rounds.
Round 1. You send: "Create a table to track monthly expenses with columns Date, Category, Description, Amount, and Paid By." Gemini builds the table. The headers are right, but the Amount column is formatted as plain text.
Round 2 (manual edit). You select column D and apply a currency format through the Format menu. This is a single formatting change, so a manual edit is quicker than a prompt.
Round 3 (follow-up). You add sample rows and send: "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." Gemini returns a formula. You test it on a row where D is 100 and expect 110. A blank D row stays blank. The result passes, so you apply it.
The whole session used one prompt for structure, one click-based edit for formatting, and one prompt for the formula, and it checked the result before applying it. That mix is the pattern to aim for.
Exercise
You asked Gemini for a total per Category and it returned =SUMIF(B2:B, "Groceries", D2:D). You wanted a table with every category and its total. Write a follow-up prompt that fixes this, and name two details the prompt should state.
Show answer
A good follow-up is: "Instead of one SUMIF for Groceries, give me a table with one row per Category and its total Amount, using A1:E with row 1 as headers, and ignore rows where Amount is empty." The prompt should state the data range with the header row (A1:E, row 1 as headers) and the edge case (ignore empty Amount rows). Naming the desired output, one row per category, is also essential.
Exercise
After you applied =ARRAYFORMULA(IF(D2:D="", "", D2:D*1.1)) in F2, the cell shows #REF!. Old formulas still sit in F3:F100. What is the cause, and what is the fix?
Show answer
An array formula needs the cells below it to be empty so it can spill its results. The old formulas in F3:F100 block it. Clear F3:F100, then reapply the formula in F2.
Exercise
Name two situations where a manual edit is better than another follow-up prompt, and one where a prompt is better.
Show answer
Manual edit: changing a single number format or chart title, and correcting a mistake Gemini has repeated after clear instructions. Prompt: adding several columns with formulas, or asking which function suits a task, because the change spans many cells or needs an explanation.