Automate·Intermediate·30 min·Updated Oct 1, 2026

Optimize financial operations with a Copilot-written Python script

Ask Copilot to write the Python script that automates a tedious recurring finance task instead of doing it by hand every cycle.

Download PDF

Microsoft 365

Works With

Business Outcome

A reusable script that replaces a manual data-collection or reconciliation step every reporting cycle.

Workflow Overview

Excel
Copilot

Step 1: Describe the manual task in plain languageExcel

Write out exactly what you currently do by hand — which files you open, what you copy, what you calculate — as if explaining it to a new analyst. Vague requests produce scripts that miss edge cases your manual process already handles.

Step 2: Ask Copilot to write the Python scriptCopilotExcel

Give it the task description and a sample of the input data, and ask for a Python script using Excel's built-in Python integration rather than a macro — it's easier to read and debug later.

Prompt idea:

Here's how I currently reconcile these two exports by hand: [steps]. Write a Python script I can run in Excel that does the same thing, and flag any row it can't confidently process instead of guessing.

Step 3: Test it against a cycle you've already reconciled manuallyExcel

Run the script against last month's data, where you already know the correct answer, before trusting it on new data.

Step 4: Save it as the new standard processExcel

Save the script in the workbook's Python cell with a short comment block above it explaining what it does and which files it expects as input, and note in your team's process documentation where to find it — without that pointer, the next person doing this task defaults back to the familiar manual version instead of discovering the script exists.

Source: Microsoft Copilot Scenario Library — Optimize your financial operations (2026)

Check the work

  • The script's output matches a manually-reconciled prior period exactly.
  • Every flagged/skipped row is reviewed, not silently ignored.
  • The script is saved somewhere the next person doing this task will actually find it.

Expected Outcome

A working Python script, run from Excel, that produces the same output the manual process did — in minutes instead of hours.

✓

AI is the right call here

Writing correct code from a plain-language description of a manual process is a skilled task worth AI's help. Notice the output itself is a deterministic script — once it's built and tested, every future cycle runs with no further AI involved at all.

Related Workflows

WORK WITH LIMINALS

Make AI useful for your team.

Get practical help with AI consulting or ask about training courses for your team.