AI for Spreadsheets: Formulas, Clean Data and Pivot Tables for Student Projects

AI for Spreadsheets: Formulas, Clean Data and Pivot Tables for Student Projects

A spreadsheet problem is rarely a lack of functions. More often, a formula almost works, a dataset was typed in three different ways, or a pivot table answers a slightly different question from the one in the assignment. AI can help with all three, but only if you stay in charge of the result. This guide gives you a workflow you can defend: describe what you want in plain words, test the formula on three rows you can check by hand, clean data without deleting evidence, and build pivot tables and charts from survey or lab data. It covers Sheets with Gemini, Excel with Copilot, and drafting formulas in a general chat tool, with licence limits stated honestly.

The short answer

  • Describe the result, not the function. Say what each row should show, which columns it comes from, and what should happen with blanks and errors.
  • Test every AI-written formula on three rows you can check by hand. If it fails on a row you understand, it will fail silently on rows you do not.
  • Clean on a copy, and decide every deletion yourself. AI can spot duplicates, inconsistent dates and blank cells. Only you can decide whether two similar rows are the same response or two real cases.
  • A pivot table is a question, not a decoration. Choose rows, columns, values and filters to answer one question, and check whether it counts, sums or averages before quoting a number.
  • Use the tool you actually have. Gemini in Sheets and Copilot in Excel both need an eligible plan or licence. Without one, a general chat tool can draft a formula from a small anonymised sample, if you test it and never paste personal data.

Describe the formula, then prove it on three rows

Start with words, not a function name. Write one sentence a classmate could follow without seeing your spreadsheet: what should appear in the new column, for each row, using which columns, and what should happen when something is missing. "For each student, show the average of the three lab marks in columns C, D and E, ignoring a blank mark rather than treating it as zero" is a specification. "Give me an average formula" is not. The first lets you check the answer; the second leaves you guessing what the tool assumed about blanks, where spreadsheet errors hide.

Give the tool only the minimum it needs. Inside Sheets or Excel, an integrated assistant can already see the sheet. In a general chat tool, paste only headers and two or three anonymised example rows, and type out the expected result yourself. Never paste a full dataset, names, student numbers or email addresses into a chat tool.

When you receive a formula, put it in the first data row only and check it against three rows: one ordinary, one awkward, and one edge case. The awkward row has a blank, a zero, or text where a number should be. The edge case sits on a boundary, such as a mark exactly on a pass threshold. Work out the correct answer for each row by hand before looking at what the formula returns. If any row is wrong, tell the tool exactly which row failed and what the answer should have been, and test the corrected version the same way. Only when all three are right should you copy the formula down, and then scan for impossible results, such as an average above the maximum mark.

Learn the functions that cover most student work, so you can read what AI gives you. SUMIF, COUNTIF and AVERAGEIF add, count or average only rows meeting a condition. XLOOKUP, and the older VLOOKUP, pull a value from another table; either fails quietly if lookup values do not match exactly, including extra spaces. IF makes a simple choice, such as "Pass" or "Review". IFERROR can replace an error with a blank, but never use it to hide an error you have not understood.

When a formula returns an error, read it before asking for a replacement. A reference error usually means a deleted row or column; a value error often means text where a number was expected, or a date stored as text; a lookup error usually means the value differs by a space or spelling. Gemini in Sheets can help fix formula errors, and Copilot can help in Excel, but the fix still needs the three-row test. Note the final formula and what it does, so you can follow it a week later see article #58: AI for Statistics: SPSS vs R vs Python — Which One, and How AI Helps.

Cleaning data: let AI find the mess, you decide what to fix

Survey exports and shared group files arrive messy in predictable ways. The same answer appears as "Yes", "yes" and "Y". Dates appear as 3 April, 03/04 and April 3, with no agreement on whether 03/04 means 3 April or March 4. A column that should hold numbers also holds blanks, dashes and the word "none". AI is useful as a spotter: ask it to list inconsistencies, find likely duplicates, and flag blanks and values that do not match the expected pattern. It cannot decide whether two rows are duplicates, whether a blank means "not asked", "declined to answer" or "not yet entered", or whether an unusual value is an error or a real outlier.

Go through the mess in a fixed order, on a copy — never the original export, which stays untouched. First, standardise formats without changing values: trim extra spaces with TRIM, make category spellings consistent, and convert dates to one format so a date is stored as a date, not as text. Second, deal with blanks explicitly. Count them, and decide for each column what a blank means before filling or removing anything. A blank lab mark may mean the experiment was not run; a blank survey answer may mean the question was skipped. Replacing both with zero would invent data. Third, treat duplicates as candidates to judge, not a list to delete. Check each candidate against timestamps or other information, delete only rows you can justify, and record how many you removed and why. Add a cleaning note: what you changed, why, and how many rows were affected.

Dates deserve special care, because the same digits mean different days in different conventions. Apply one format, such as day-month-year, to the whole column, then sort and check the order. Check a handful of dates against the source, especially near the start of a month. Likewise, a value stored as text is skipped by SUM and AVERAGE without warning, so a low total may be a formatting problem, not a finding. Cleaning is finished when every column has one format, every blank has a meaning you could explain, and you can say how many rows were removed or changed and why see article #87: AI for Surveys and Questionnaires: Design, Analyse and Report Honestly.

Cleaning problemWhat AI can spotWhat you must decide
Duplicate rowsRows matching on answers or timestampOne submission twice, or two real cases
Inconsistent datesDates stored as text, mixed formatsWhich day-month convention is correct
Blank cellsHow many blanks, in which columnsWhat a blank means in that column
Inconsistent categories"Yes", "yes", "Y", extra spacesThe single spelling to use
Numbers stored as textValues a total silently skipsReal number, code, or note

Pivot tables and charts from survey or lab data

A pivot table answers one question by grouping rows and summarising them. Rows are the groups to compare, columns are a second split if needed, values are what gets summarised, and filters limit the data to the subset the question is about. Decide the question in words first: "What is the average satisfaction score for each year group, split by whether students attended the workshop?" That sentence already contains the rows, columns, value and filter. If you cannot write the question in one sentence, you are not ready to build the table.

In Google Sheets, Gemini can create pivot tables and charts from a selected range when asked from the side panel. In Excel, Copilot can help build a pivot table from data formatted as an Excel Table. Check the result the same way in both: read the labels, confirm the value is summarised as intended, and confirm the filter includes exactly the rows it should. The summary choice changes the story. Counting tells you how many answered. Averaging tells you the typical response, but hides the spread: a group averaging 3 out of 5 because everyone answered 3 differs from one averaging 3 because half answered 1 and half answered 5. Add a count alongside an average, so the reader sees how many responses each average rests on.

Lab data needs one extra step: group repeated measurements before comparing conditions. If each sample was measured three times, summarise the repeats for each sample first, then compare samples or conditions. Averaging all raw readings together gives extra weight to whichever sample has more readings, and hides variation within a sample. Where a measurement failed, record whether that sample is excluded, kept with fewer repeats, or repeated, rather than letting a blank be averaged as zero. If you filter to completed surveys only, say so under the table.

Charts follow from the table. A bar chart compares categories. A line chart shows change over time, only where the horizontal axis is genuinely ordered in time. A pie chart shows parts of a whole, only when the parts add up to a whole; a pie chart of average scores is meaningless. Keep every chart to one message, label the axes with units, and state the number of responses it rests on. AI can draft a chart, but it will not know whether a line chart implies a trend your data cannot support, or whether a chart starting above zero exaggerates a small difference see article #85: AI for Data Visualisation: Charts Your Reader Actually Understands.

Before quoting a pivot table, reproduce its headline number a second way, with COUNTIF or a filtered average. If the methods disagree, the table is filtered, grouped or summarised differently from what you assumed.

Which tool you actually have: Sheets, Excel, or a free chat tool

The three routes look similar and differ in what they can see, what they can change, and what they cost. Check which one you actually have before building a workflow around it. Look for the Gemini side panel in Sheets, or Copilot in Excel. If it is not there, or it asks for a plan or licence you do not hold, that is your answer. Do not assume a university account includes it. Eligibility depends on the specific plan, and the vendor's current support page is the authority.

In Google Sheets, Gemini requires an eligible Google Workspace or Google AI plan. It works best with native Google Sheets files, so convert an Excel file first through File, then Save as Google Sheets. You can ask Gemini to create a formula starting from a cell with Ctrl+Alt+G on Windows or ChromeOS, or Cmd+Ctrl+G on macOS. It can fix formula errors, create tables, pivot tables and charts, and apply formatting. On mobile it can analyse data but cannot directly edit or format. Do not assume Gemini in Sheets is free for all students.

In Microsoft Excel, Copilot requires an eligible licence: a Microsoft 365 Personal or Family subscription with an AI credits plan, a Microsoft 365 Premium subscription, a commercial Microsoft 365 Copilot subscription, or a Copilot Chat-eligible business or enterprise subscription. Format data as an Excel Table with headers, using Ctrl+T, and save the file in the cloud, because Copilot works best that way. The =COPILOT() function was retired on 14 September 2026 and is no longer available; use Copilot through the Excel interface instead, and test its suggestions with the three-row check.

RouteWhat you needWhat it can doMain limit
Gemini in Google SheetsEligible Workspace or Google AI planFormulas, tables, pivot tables, charts, formattingNative Sheets files; mobile cannot edit
Copilot in Microsoft ExcelEligible licence, as listed aboveWork with an Excel Table in a cloud-saved fileNeeds Table format; =COPILOT() is retired
General chat toolChat account, small anonymised sampleDraft and explain formulas, suggest pivot stepsCannot see or edit your file; never paste personal data

The free workaround is the route most students will actually use. A general chat tool such as ChatGPT, Gemini or Claude can draft a formula from your description and a small sample of headers plus a few anonymised rows, and suggest a pivot-table structure. Label it honestly as drafting help: it cannot see or edit your file. Every formula needs the three-row test, and nothing containing names or other personal data should ever be pasted into it. If your university provides an AI service, prefer it, and check course rules on disclosure for assessed work.

Privacy, checking, and what AI must never decide for you

Spreadsheets hold data that causes real harm when it leaks: names linked to marks, survey answers linked to identities, and lab data linked to participants. Before asking any AI tool for help, ask what is in the file. If a column contains names, student numbers, email addresses, health information or interview responses, that column stays out of every prompt. Anonymise any sample you share: replace names with codes kept separately, drop columns the question does not need, and use a handful of rows, not the whole dataset. Integrated assistants work within your account and file, which differs from pasting data into a public chat tool, but check your university's rules in either case.

Checking is the workflow, not a final step. Check the formula on three rows before copying it down, the cleaning note against the original after each change, and the pivot table's filter and summary choice before quoting a number. Check final headline numbers against the spreadsheet after every edit.

AI must never decide which duplicates to delete, which outliers to exclude, which responses count as complete, or what a blank means. It must not decide your conclusion or whether a difference is meaningful. It can surface candidates and draft wording, but the decision, the reason, and the record belong to you.

Frequently asked questions

Can AI write all my spreadsheet formulas for me?

It can draft them, but it cannot take responsibility for them. Every formula still needs the three-row test and a scan of the full column for impossible results. The formula is yours the moment it is in your file, so check it as if you had written it yourself.

Do I need a paid plan to get AI help with spreadsheets?

Not necessarily, but the integrated assistants do need one. Gemini in Sheets requires an eligible Google Workspace or Google AI plan, and Copilot in Excel requires one of the eligible licences listed here. The free workaround is a general chat tool drafting formulas from a small anonymised sample, with you testing and editing by hand.

What should I do when an AI formula returns an error?

Read the error before asking for a replacement. Check whether a range misses the first data row, whether a lookup value matches exactly including spaces, and whether a column contains text where numbers were expected. Describe the specific failure: which row, what the answer should be, and what the formula returned.

Is it safe to paste my survey data into a chat tool to get help cleaning it?

No, not as a full dataset, and never with names or other personal data. Paste only headers and a few anonymised example rows. For the real cleaning, work in the spreadsheet itself, on a copy. If your data includes interview or health information, do not paste any of it into a public chat tool.

Can I use the =COPILOT() function in Excel?

No. It was retired on 14 September 2026 and is no longer available. Use Copilot through the Excel interface instead, if you hold an eligible licence, and test its suggestions with the three-row check. Without an eligible licence, use the free workaround in this guide.

The bottom line

A spreadsheet with AI help should be easier to defend, not harder. Describe the result you want, test the formula on three rows, clean a copy while keeping the original untouched, build each pivot table to answer one question, and reproduce every headline number a second way. Use Gemini in Sheets or Copilot in Excel if you hold an eligible plan or licence, and a general chat tool as drafting help if you do not. Never paste personal data into a prompt, and never let a tool decide what to delete or what a finding means.

Related guides

Facts here were checked against official pages in November 2026: Google Support, "Collaborate with Gemini in Google Sheets", and the Microsoft Support FAQ on editing with Copilot in Excel. Licences, eligibility and limits change over time, and the vendor's current page wins over any summary here where they differ.