Sub topic 5
Building tables and templates
This chapter covers how to ask Gemini in the Google Sheets side panel to build a table or a reusable template. It also covers how to adjust the result afterward. It assumes you can open the Gemini side panel and write a basic prompt. It also assumes you know what a header row, a range, and a data type are. Chapter-level goals: write a prompt that produces the layout you want, insert it safely, and fix the common structural errors.
What "generate a table" means in Sheets
When you ask Gemini to create a table, it proposes a block of cells: a header row, sometimes sample rows, and sometimes formatting. The side panel shows a preview. Nothing changes in your sheet until you choose to insert it.
A table you generate is only a starting point. Gemini does not know your accounting rules, your naming habits, or which columns you will later sum or chart. You supply those details in the prompt, and you confirm them in the preview.
Two terms are used in this chapter:
- A table is a block of data with one header row and one record per row.
- A template is a table or sheet set up to be filled in repeatedly, usually with empty input rows, formulas that are already in place, and formatting that guides data entry.
Writing a table prompt
A good table prompt states four things: the purpose of the table, the column headers, the order of the columns, and any constraint on the values. The first example below gives the purpose and all five headers.
Create a table to track monthly expenses with columns Date, Category, Description, Amount, and Paid By.This prompt works because it names every column. If you leave the headers out, Gemini chooses them, and its choices may not match the formulas and charts you plan to build later. Naming the headers up front keeps the table aligned with the clean layout described earlier in the tutorial: headers in row 1, one record per row, and one type of value per column.
You can add detail without making the prompt long. Useful additions include:
- The number of sample rows, for example "with 5 sample rows".
- The data type of a column, for example "Amount as currency" or "Date as a date".
- Allowed values, for example "Category limited to Groceries, Rent, Utilities, Transport, and Other".
- Where to place it, for example "starting in cell A1 of a new sheet".
A fuller version of the same request:
Create a table to track monthly expenses with columns Date, Category, Description, Amount, and Paid By. Format Date as a date and Amount as currency. Limit Category to Groceries, Rent, Utilities, Transport, and Other. Add 5 sample rows.Prompts that go wrong
The most common failure is a vague prompt. Compare these two.
| Prompt | Likely result |
|---|---|
| "Make me a budget." | Gemini guesses the structure. You may get a layout with merged cells, a title row above the headers, or several small blocks side by side. |
| "Create a table with columns Date, Category, Description, Amount, and Paid By." | A single block with one header row and the five columns you named. |
The first result may look nicer, but it is harder to use. Merged cells and decorative title rows break sorting, filtering, and later formulas such as QUERY. If a preview contains them, say so in a follow-up prompt, or fix them by hand.
The generate, preview, insert workflow
Follow the same steps each time.
- Select a cell where the table should start. An empty area is best. If you select a cell inside existing data, the insertion can collide with it.
- Open the Gemini side panel and enter your prompt.
- Read the preview. Check the headers, their order, the data types, and whether there are extra rows or merged cells.
- Choose to insert the table. If the result is close but not right, refine it with a follow-up prompt before inserting.
- Inspect the inserted cells in the sheet itself, not only in the preview.
Building a template
A template differs from a table in one way: it is meant to be reused. You are building the empty form, not recording one batch of data. Prompts for templates should say what stays fixed and what gets filled in.
Create a monthly expense template on a new sheet with columns Date, Category, Description, Amount, and Paid By. Leave rows 2 to 50 empty, and add a Total row below the table that sums the Amount column.Some details are worth deciding before you ask.
- Where the total goes. A total directly beneath the data can be mistaken for a record by a later QUERY or chart. A safer pattern is to place totals above the table, or on a separate summary area, so that the data block stays pure.
- Input rows. Gemini may generate only a few blank rows. If you need room for 50 entries, say so.
- Dropdowns. Prompting for "Category limited to ..." usually produces a dropdown in the column. Check this in the sheet by clicking a cell in the column. If the dropdown is missing, add it manually with Data validation.
- Formulas in a template. A template can include a formula column, such as a tax column. State the target column, the source column, the calculation, and the edge case, as in this prompt:
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.The blank-cell instruction matters. Without it, the formula may show 0 in every unused row, which clutters the template and distorts any later total or chart. The next chapter covers formula prompts in more detail. Here it is enough to know that a template can carry them.
Checking the structure you get back
After you insert a table, check it against the layout rules that later steps depend on. A table that fails them will cause trouble when you ask for formulas or charts.
| Check | What to look for | How to fix it |
|---|---|---|
| One header row | Headers in row 1, with no title row above them | Delete the extra row, or ask Gemini to regenerate without a title |
| No merged cells | Each header and value in its own cell | Select the range and use Format, then Merge cells, then Unmerge |
| One record per row | No subtotal or blank separator rows inside the data | Delete them, and move totals outside the data block |
| Consistent types | Dates are real dates, amounts are numbers | Reformat the column, and retype any values stored as text |
| Matching headers | Headers match the names you asked for | Edit the header cell directly |
Text that looks like a number
Sample data sometimes arrives as text. A value such as $12.50 or 2026-11-03 can be left-aligned and treated as a string. A SUM over a text column returns 0 or ignores those cells, so a total looks wrong with no error message. To test a column, select its cells and look at the sum shown in the lower-right corner of the sheet. If nothing appears, or the figure is lower than expected, the values are probably text. Reformat the column as Number or Date, then re-enter a value to confirm it sticks.
Adjusting a table with follow-up prompts and manual edits
Once a table exists, you have two ways to change it: another prompt, or a direct edit. Each is better for different jobs.
| Change | Better approach |
|---|---|
| Rename one header | Edit the cell directly |
| Add a column with a defined purpose | Follow-up prompt |
| Add a dropdown list of allowed values | Follow-up prompt, then verify, or use Data validation |
| Apply consistent formatting to a large range | Follow-up prompt or the toolbar |
| Fix one wrong value | Edit the cell directly |
| Reorder several columns | Follow-up prompt, or drag manually |
A follow-up prompt should refer to the existing table by its location and column names, because Gemini works from what is on the sheet:
In the table in A1:E6, add a column G named Reimbursed with a checkbox in each row, and freeze row 1.A request that says "make it better" gives Gemini nothing to act on. A request that names the range, the change, and the result gives you something you can check.
Edge cases and limits
- Existing data nearby. Gemini reads the sheet it can see. A new table placed next to existing data can confuse later prompts, because the combined block may look like a single table. Leave at least one empty row or column between separate blocks.
- Large sample sizes. Asking for hundreds of sample rows may return fewer rows than requested. Count the rows you get.
- Invented sample data. Sample rows are placeholders. Delete them before you use a template for real records, and do not copy invented figures into reports.
- Formatting that does not carry over. Colors, number formats, and column widths may not all be applied. Treat formatting as something to confirm, not assume.
- Repeatability. The same prompt can give a slightly different layout on a second run. Once you have a layout you like, duplicate the sheet and reuse that copy instead of regenerating. To make a template reusable across files, use File, then Make a copy.
Summary
State the purpose and the headers in the prompt. Review the preview, insert into an empty area, and check the inserted cells against the layout rules: one header row, no merged cells, one record per row, consistent types. Use follow-up prompts for structural changes and manual edits for small fixes.
Exercise
You ask Gemini for a monthly expense template. The inserted table has a title in row 1, the headers in row 2, and a Total row directly under the last data row. Later you plan to use QUERY and a chart on this table. Name two problems and say how you would fix each.
Show answer
First, the title row above the headers means the header is not in row 1, so QUERY with a header count of 1 and charts that detect headers can treat the title as a header or as data. Delete the title row (or move it outside the data block) so the headers are in row 1. Second, the Total row sits inside the data range, so QUERY and charts will treat it as a record and count it as an extra category or double the totals. Move the total above the table or to a separate summary area, or ask Gemini to regenerate the template without a title row and with the total outside the data block.
Exercise
A generated table shows Amount values left-aligned, and the sum in the lower-right corner of the sheet is missing when you select the column. What is the likely cause, and what do you do?
Show answer
The values are stored as text rather than numbers, so Sheets does not add them. Select the Amount column, format it as Number or Currency, and re-enter a value to confirm it is recognized as a number. Then check that the selected-cells sum appears and matches a manual addition of a few values.