An interactive guide to Copilot skills
How JSON and Python fit into an Excel skill
An expense table tells you what was budgeted and spent, but a useful review also needs calculations, decisions about what deserves attention, and a layout someone can read. A custom skill can save the instructions for turning that source table into a report.
The example below follows two rows through that process. You'll see what Copilot reads from the workbook, what the saved Python script adds, and how the JSON settings tell Copilot where each result should go and how it should look.
Start with the values in the workbook
The Data sheet has two expenses and three columns. It tells us what was budgeted and spent, but it does not yet calculate an overrun, decide what needs review or lay out a report for a manager.
tblExpenses| Expense | Budget | Actual |
|---|---|---|
| Food | 2000 | 2600 |
| Supplies | 1000 | 1500 |
Use the expense-review skill to check tblExpenses. Run its saved Python script, apply the selected JSON layout and create a report on a new sheet. Keep Data unchanged.
This is an illustrative request for the combined workflow shown here.
The source data has changed. Run the demo to refresh the calculated results and report.
Expense Budget Actual
Food 2000 2600
Supplies 1000 1500
These are the inputs to the review. The report calculations and presentation have not been added yet.
The report starts here
As you move through the steps, this area will show the prepared input, calculated results, layout mapping and finished report.
See the structured results returned as JSON
Select Next to follow the work in order, or choose a step to examine a particular handoff.
This browser simulation combines the layout and calculation ideas from my two tutorials, using two fictional expense rows. It doesn't execute Python or connect to your workbook; the linked tutorials include the files for their separate Excel exercises.
This browser has JavaScript disabled. The source data is visible above. In the full workflow, the skill checks those values and passes them to Python, which adds an overrun and review flag. JSON maps the resulting fields to headings and display formats, and Copilot writes and checks a separate report sheet. Food is $600 over budget and qualifies; Supplies is exactly $500 over and does not.
Do I need these extra files for every skill?
Probably not. If a prompt or a simple skill already handles the job, there may be little to gain from adding more files. JSON becomes useful when you have settings you expect to change, such as a client's preferred headings or the columns in a monthly report. It gives those choices a clear place to live, although someone still has to check that the output follows them.
Python is useful when you want to save and reuse a particular calculation or data-checking routine. Copilot needs an available Python execution tool to run that code, and the result still depends on the script receiving the right data. In this example, changing a source value means running the skill again to update the report; it works separately from Excel's =PY() worksheet feature. If you need cells to update as you type, ordinary Excel formulas may be the better fit.
Follow along in Excel
Each tutorial includes a workbook and prepared skill files, so you can try the example without writing everything from scratch.
Use JSON to structure Copilot outputs in ExcelUse Python scripts in a custom Excel skill
Read more from Microsoft
These guides explain how skills use supporting files and how Python execution fits into Copilot.
Excel skills: instructions, references and scriptsPython execution while editing with CopilotHow Microsoft's code interpreter runs code