Copilot in Excel, step by step
Your progress
0 lesson completed out of 14

A lesson is completed when you tick it, when you watch its video to the end or when you score 80% on its quiz. The certificate is issued online after the final assessment, from a score of 32 out of 40.

Your progress is saved in this browser. Log in to your client area to pick it up on your other devices.

Video transcript

Lesson 12, module 4: Advanced features Python in Excel and the Analyst agent for analyses that formulas can't do Do hotels pay later than restaurants? A formula answers that poorly.

Python in Excel: code in a cell, calculated in the cloud. =PY or Formulas, Insert Python xl() reads a whole table Ctrl+Enter confirms the cell Copilot writes the code, you read it. Prompt: Analyse October sales with Python, by week and by customer, with a chart. Code commented in French. Answer: A PY cell: xl("Ventes[#All]", headers=True), ISO week, table of 7 customers × 5 weeks, total 8,071.00. Week 42 on top with €2,304.50 excl. VAT. Read the code before the result. [Diagram: From prompt to reviewed result] 1. Prompt 2. PY cell 3. Result 4. Reading the code 5. Control recalculation Read the code before the result: it's the code that tells you which rows were included. Week 40: €748. A weak week? No, two days of October. 1 and 2 October only 288.00 + 460.00 Reading the code showed it Hotels 20.5 days, restaurants 22 days. On two invoices each. Python gives a precise figure The sample allows no conclusion Formula, PivotTable, Python or Analyst: the simplest that answers. [Diagram: Formula, PivotTable, Python or Analyst?] 1. Does the question go beyond a sum, a count or an average per category? 2. Do you need a calculation formulas handle badly: matching two tables, statistics, a chart built by code? 3. Does the data fit in a single open workbook? Yes to all: Python in Excel: a PY cell, commented code that's been reviewed, a result that recalculates in the workbook. In the exercise, you analyse the basket at the Libourne shop. Your turn: The average basket at the Libourne shop The written lesson, the corrected exercise and the quiz are below the video.

Lesson 12 of 14 · module 4, advanced features

Python in Excel and the Analyst agent for analyses formulas can’t do

Python in Excel runs code in a PY cell, calculated in Microsoft’s cloud, and Copilot can write it for you in Edit mode. The Analyst agent, available only with a licence, analyses data in the Microsoft Copilot app. Both help when formulas struggle, provided you read the code and redo a total.

  • 28 min of reading
  • 1 min 51 of video
  • 6 diagrams
  • 3 demandes to copy
  • 3 exemples pratiques
  • 4 exercices answerss
  • 5 questions
  • 1 ressource

By the end of this lesson, you will know how to

  • Check that your plan and version include Python in Excel, then read a table with the xl() function
  • Have Copilot write a Python analysis commented in French, and check it line by line before trusting the result
  • Choose between a formula, a PivotTable, Python and the Analyst agent based on the question and the effort

What’s covered

  1. What Python in Excel is
  2. Have Copilot write the code
  3. Do hotels pay later than restaurants?
  4. The Analyst agent, when the data goes beyond the workbook
  5. 3 worked examples, followed from start to finish
  6. Exercise with answers · Average basket at the Libourne shop
  7. 3 practice exercises, from guided to demanding cases
  8. The quiz

Key points

  • Python in Excel is written in a PY cell, calculated in Microsoft’s cloud and reads the workbook through xl(), for example xl("Ventes[#All]", headers=True).
  • It works on Windows, Mac and the web, not on iPad, iPhone or Android; premium compute is capped each month.
  • When Copilot writes the code, you read it line by line, then redo a total with a formula.
  • The Analyst agent lives in the Microsoft Copilot app and requires a licence; it is useful when the data goes beyond one workbook.
  • A precise figure based on fourteen invoices is still only a lead: the simplest tool that answers the question is the right one.