Sub topic 9
Creating Charts from Your Data
Assume you know how to select a range in Google Sheets and identify column headers. You should also have a sheet with clean, consistent data and access to Gemini in Sheets. Gemini can suggest or create a chart, but you still need to check whether the chart represents the data correctly.
Prepare the data
Before asking Gemini to create a chart, check the source range:
- Put one header in the first row of each column.
- Keep one record per row.
- Use consistent values in category columns.
- Store numbers as numbers, not text.
- Remove blank rows and unrelated notes from the range.
- Decide which column is the measure, such as
AmountorUnits. - Decide which column groups the measure, such as
CategoryorMonth.
For example, a spending table might contain Date, Category, Description, Amount, and Paid By. A chart of spending by category should use Category as the grouping and Amount as the measure.
Ask Gemini for a chart
Open the Gemini side panel in Google Sheets and describe the chart’s purpose. Name the chart type, measure, grouping, source range, and title.
Create a column chart of total Amount by Category using the data in A1:E50, with the title "Spending by Category".This prompt gives Gemini enough information to make several decisions explicitly:
| Prompt detail | Example | Why it matters |
|---|---|---|
| Chart type | Column chart | Controls how values are displayed |
| Measure | Amount | Identifies the numbers to compare |
| Grouping | Category | Identifies the labels on the chart |
| Data range | A1:E50 | Limits the source data |
| Title | Spending by Category | Explains the chart's purpose |
Gemini may create a chart directly, suggest steps, or return a chart configuration depending on your account and the current Sheets interface. Review the result before sharing it.
Refine the chart
A first result may use the wrong chart type or include an unwanted series. Use a follow-up prompt that names the exact change:
Change the chart to a horizontal bar chart. Use Category for the labels and Amount for one series only. Sort the categories from largest total to smallest total, and keep the title "Spending by Category".You can also make these changes manually in the chart editor. Choose a column chart for comparisons across a small set of categories, a line chart for values over time, and a pie chart only when showing parts of one whole is useful. A chart with too many categories may be difficult to read, even if the data is correct.
Ask Gemini to clarify ambiguous results:
Explain which range is the chart source, which column is the series, and how blank or text values are handled. Do not change the chart.Verify the result
Compare the chart with the source data before relying on it. Check that:
- The title describes the displayed measure.
- Every intended category appears.
- The chart does not include a totals row twice.
- The number of series is correct.
- Dates are ordered chronologically.
- Filters or hidden rows have not changed the intended scope.
- A few displayed values match manual calculations or a pivot table.
If the chart shows totals by category, calculate one or two categories independently with a formula such as =SUMIF(B2:B, "Groceries", D2:D). A matching value does not prove every category is correct, but a mismatch identifies a problem to investigate.
Exercise
Exercise
Your sheet uses A1:E50, with Category in column B and Amount in column D. Write a prompt for a line chart showing total Amount by Month, using a Month column in column A and the title "Monthly Spending".
Show answer
Create a line chart of total Amount by Month using the data in A1:E50, with Month in column A as the horizontal axis and Amount in column D as the measure. Use the title "Monthly Spending".