Find spreadsheet anomalies with AI and verify the flags

Define the rules, request traceable candidate rows and verify the evidence before correcting duplicates, missing values or statistical outliers.

Magnifying glass over a paper spreadsheet with several blue cells

Upload an approved working copy, tell ChatGPT the rules your spreadsheet must follow, and ask for a separate list of suspicious records with their original locations. Check each candidate against the source before correcting anything. I'd start with missing required values and duplicate keys, then examine statistical outliers within comparable groups: an unusual amount can be a perfectly valid transaction.

Define the records and rules

Keep the original file unchanged in its approved location. Prepare a separate copy containing only the data the task needs, and follow your organization's rules before sending that copy to an AI service. Preserve a private way to match the copy's record identifiers to the source if you replace sensitive identifiers.

Use the file-upload route in ChatGPT for this workflow. OpenAI lists Excel and CSV among the supported analysis files, with availability depending on your model, plan and workspace. The native ChatGPT add-ins for Excel and Google Sheets can work inside a spreadsheet and edit cells; those actions need their own permission and change review. Uploading a copy keeps this task focused on a report you can check.

Write one sentence defining a row. For example, in a made-up order export, a row might represent an order line, with order_id and line_number together identifying it. Several lines sharing an order number would then be expected. A repeated pair would need review. An identifier can be a useful source locator without being unique, so retain the original sheet and row location too.

Give ChatGPT the rules you already know. A required delivery date, an allowed status list and a quantity range are explicit checks. A large order value is a statistical candidate unless a documented business rule supplies a maximum. Don't ask the assistant to invent business limits from the largest values it happens to see.

Before scanning, establish these details:

  • The sheet or table, included records and original row or cell locations. For a CSV, define the locator as a parsed record number plus a stable identifier.
  • The columns that together should be unique, and whether case or surrounding spaces matter. Keep raw values alongside any normalized comparison values.
  • Required fields and the meaning of blanks, zero and labels such as N/A.
  • Units and comparison groups, such as currency and retail versus wholesale orders.

Confirm that ChatGPT read the intended sheets and record count before relying on any flags. OpenAI warns that a successful upload can still produce incomplete analysis when a file is too large, complex or poorly structured. If scope doesn't match the copy, resolve that first. Scanning a sample doesn't establish that the rest of the file is clear.

Ask for a bounded scan

In the web chat, select + → Add photos & files and choose the working copy, then replace the bracketed fields in this prompt. Start with rules you can explain and independently check. Leave statistical scanning for the next section if you haven't chosen a comparison group or method.

Review the attached working copy without changing, deleting or filling any source values. Return findings in chat; don't create a replacement workbook yet.

Scope: [file, sheet/table, included records]. One row means [record definition].
Source locator: [original sheet/row or parsed record number] plus [record ID]. Preserve these before sorting or filtering.
Unique key: [columns considered together]. Compare using [case/space rules], while retaining raw values.
Required fields: [columns]. Missing-value conventions: [blanks, codes, zero meaning].
Other explicit rules: [allowed values, ranges and units, or none supplied].

First confirm the scope, record count, column types and any unread or excluded records. Stop for clarification if these don't match the supplied definitions.

Then apply the stated rules. Return every candidate with its source locator, column, original value, rule, supporting comparison and a reason to review it. For repeated keys, show every member of each group, including the first. Report groups and excess occurrences separately.

Report counts per rule and the number of distinct affected records; a record can trigger more than one rule. State any incomplete checks. Show the method and, if code was used, the code and outputs needed to check it. Don't infer fraud, invent corrections or declare the whole file error-free.

The result needs enough detail to open a candidate in the original. A claim such as "several suspicious transactions" doesn't meet that requirement. Ask for the missing locators or rule evidence before discussing fixes. For code-backed analysis, OpenAI recommends reviewing the generated code, outputs and assumptions; requesting a method doesn't establish that the assistant followed it.

A published workbook demonstration shows the value of checking the answer outside the chat. In Leila Gharani's July 2026 Excel walkthrough, ChatGPT returned 12 products with negative profit margins, matching the count in her Power Pivot model. That is a result for her workbook and calculation. It supports the verification step, without supplying an accuracy rate for detecting errors in yours.

Verify duplicates and missing values

Open every member of a repeated-key group. Compare the source details that establish the record's identity. A repeated invoice number across different suppliers can be valid; two exports of the same invoice line may be an accidental copy. Similar names or matching amounts alone don't settle the decision.

Check the counting convention too. In a constructed group of three identical keys, there are three group members but two occurrences beyond the first. If the analysis uses pandas, its duplicated method marks later occurrences by default, while keep=False marks every member. The chosen columns determine the comparison. Ask for the whole group even if the assistant initially shows only the later rows.

For a quick check of a single key column in desktop Excel for Windows, use Microsoft's duplicate-highlighting procedure:

  1. Select the data cells in the column you want to check.
  2. Open Home → Conditional Formatting → Highlight Cells Rules → Duplicate Values.
  3. Keep Duplicate selected, choose a visible format beside values with, then select OK.
  4. Review the matching values against the candidate report and source records.
Excel Duplicate Values dialog with Duplicate selected and Light Red Fill with Dark Red Text formatting
Choose Duplicate and a visible format, then select OK. This highlights matching values for review. Scroll sideways on a small screen or view larger.

Highlighting one column doesn't verify a composite key. Review the full combination of key columns together in the candidate report. Keep Data → Remove Duplicates out of the discovery step: Microsoft says that feature permanently deletes duplicate data and recommends copying the original first. The selected columns also change the match criterion.

Review missing values under the rules for that field. An empty optional comment can be valid; an empty required record identifier needs attention. Zero quantity may mean a canceled line in one export and an error in another. Don't replace either blank or zero with a guessed average.

The parsing method matters. In pandas, isna recognizes values such as None and NaN, but it doesn't count an empty string or infinity as a missing value. A CSV import can already have converted an empty field into a missing value, so ask for the actual imported representation and any conversion. A generic "no nulls" message doesn't answer a separate rule about whitespace-only required fields or a literal N/A code.

Check the outlier method

Compare amounts within groups that have a meaningful common scale. Keep currencies separate unless you have a documented conversion, and distinguish order totals from line prices. I'd inspect a distribution within each relevant group before choosing a cutoff because a wholesale order can look extreme among retail purchases.

For an initial numeric review, you can request the box-plot fences described by NIST. The interquartile range is IQR = Q3 − Q1. The inner fences are Q1 − 1.5 × IQR and Q3 + 1.5 × IQR. Values outside those fences become candidates for investigation. Specify the column and group, then ask for the included count, quartile convention and both computed fences alongside each flag.

For a constructed arithmetic example, suppose a particular group's already-calculated quartiles are Q1 = 100 and Q3 = 140. The IQR is 40, giving fences of 40 and 200. A value of 220 crosses the upper fence. The calculation establishes a flag under those assumptions; the source record must establish whether 220 is wrong.

Recalculate a reported group's quartiles and fences in your spreadsheet using the same included records and percentile convention. Compare the resulting candidate identifiers, not only the count. If the figures disagree, inspect exclusions and conversions before accepting either list.

Don't quietly switch methods when the results look inconvenient. NIST explains that ordinary z-scores can mislead, especially in small samples, and that the distributional assumptions affect outlier identification. If ChatGPT uses a different rule, have it name and justify that rule before accepting the list. Different thresholds can produce different candidates without either output proving an error.

Small groups and repeated values deserve a pause. When Q1 equals Q3, the IQR is zero and the two fences coincide; a different value can be flagged without a useful estimate of ordinary variation. Record the limitation and use explicit business rules or an informed review. Don't force a precise statistical conclusion from an unsuitable group.

Dates create another branch. A holiday spike or gradual growth can look abnormal against one threshold over the whole year. NIST's introduction to time-series analysis identifies trend, seasonal variation and correlation over time as structures that need to be accounted for. Ask for a time-ordered plot and compare like periods before escalating a spike. If the file lacks enough context to judge the pattern, hold the candidate for review instead of inventing a baseline.

Record a decision for each candidate

Check the rule evidence first, then the original record. For a duplicate, inspect the other group members. For an unusual amount, check its units and source document. A missing field may require a new export or a question to the data owner. The chatbot's explanation of a possible cause is a lead to investigate.

Keep a separate decision column in the review report:

  • Confirmed error: record the source evidence and approved correction, or the reason a duplicate should be removed.
  • Valid exception: retain the value and record the explanation, such as a supported bulk order.
  • Unresolved: retain the source value and assign the missing check or question to the person who can answer it.

NIST distinguishes labeling a potential outlier from establishing erroneous data. An unusual point can reflect a genuine event or random variation. I wouldn't remove a row solely to make a chart look smoother; the decision needs evidence about that record.

Verify the report's scope as well as its flags. Reconcile the distinct affected-record count with the candidate rows, and remember that per-rule counts can overlap. Spot-check some unflagged records against the explicit rules, especially around a threshold or in a group with few observations. Those checks can reveal an omitted rule or parsing problem; they don't establish a measured detection rate.

If the response stops early, names only a sample or omits a sheet, mark the scan incomplete. Divide the work into explicit scopes and retain the source locators. Duplicate checks across separate chunks still need a comparison across the whole intended scope, or matching records in different chunks can be missed.

Apply approved corrections through the source system or a separately saved corrected copy, then rerun the affected checks and compare record counts and relevant totals. Save the original, the candidate report and the decision history separately. Your next useful output is a file with explainable changes and recorded open questions. For another practical workflow, return to everyday AI tasks.