How-to Civil servants, Intermediate, Across government, Analysis

How to use AI with spreadsheets and data

Get help writing formulas, cleaning messy lists and explaining trends, without pasting personal or sensitive data and without trusting any number you have not recalculated.

Last reviewed: . Reviewer: Muhammad Asadullah.

What AI is good for here

Many offices run on spreadsheets: budget releases, attendance, complaint registers, stock lists, scheme beneficiaries. An AI assistant can help you work with them faster. It is useful for three jobs:

  • Writing formulas. Describe what you want in plain words and ask for the formula, with an explanation of how it works.
  • Cleaning data. Get instructions or formulas to fix inconsistent spellings, split names from designations, remove duplicates or standardise dates.
  • Explaining trends. Ask what a summary table seems to show and what questions it raises.

AI is not a calculator you can trust. It can make arithmetic mistakes and describe a trend that is not in the figures. Treat every number it gives you as unchecked.

The main rule: describe the data, do not paste it

Do not paste spreadsheets containing personal data into a public chatbot. That includes names with CNIC numbers, phone numbers, addresses, salaries, bank details, health records and lists of beneficiaries. Do not paste budget figures or other official data that is not yet public. See data leakage.

Instead, describe the structure:

  1. List the column headings and what each one holds.
  2. Make up three or four sample rows with invented values in the same format.
  3. Say what result you want.

If you must work on real data, use only a tool your department has approved for it. Even then, share only the columns the task needs. See data minimisation. Removing names is not always enough, because other details can still identify a person. See re-identification.

Step by step: getting a formula

  1. Say which program you use. Formulas differ between spreadsheet programs and versions.
  2. Describe the columns. "Column A is district, column B is date received, column C is status (Pending, Resolved or Rejected)."
  3. Describe the result. "In a summary sheet, count pending cases per district received after 1 July."
  4. Ask for an explanation. Understanding the formula helps you spot mistakes and fix it later.
  5. Test it on a small sample where you already know the answer, before using it on the whole sheet.

Always recalculate

This is the rule that protects you. Before any figure goes into a note, a brief or a report:

  • Check totals yourself using the spreadsheet's own functions, not the AI's arithmetic.
  • Spot check rows. Pick a few at random and confirm the formula gives the right result.
  • Watch the edges. Blank cells, text stored as numbers, merged cells and dates in different formats often break formulas quietly.
  • Compare with the source. If a total does not match the figure in the original register, find out why before you rely on it.

AI can describe patterns in a summary table and suggest questions to ask. It cannot tell you why something happened. A rise in complaints from one district may reflect a new office opening, not worse service. AI may also present a guess as a finding. See hallucination and automation bias.

Use its explanation as a starting point for your own analysis. Any conclusion that goes to a senior officer must be yours, based on figures you have checked.

Example instructions

I use a spreadsheet with these columns: A district, B date received, C status (Pending, Resolved or Rejected). Write a formula that counts Pending cases for the district typed in cell F2. Explain each part in simple words.

Here are five invented sample rows with names written in different ways. Give me step-by-step instructions to standardise them and remove duplicates, without deleting the original column.

What not to use it for

  • Final figures for budgets, audits or official statistics without full recalculation
  • Any sheet containing personal data in a tool your department has not approved
  • Deciding the cause of a trend without checking the facts on the ground

For more help, see the spreadsheet formula prompt and the clean up a list prompt.