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.
Lesson 45, module 11: Automating what keeps coming back ChatGPT and Excel: getting it to write formulas, pivot tables and simple macros You know what the column should calculate. Who writes the formula? A price to look up in the price list A total per sales rep and per month A clean-up that comes round every Monday ChatGPT writes the formula if you describe the table to it. [Diagram: What ChatGPT needs to know about the table] Your Excel The table The columns Three sample rows The expected result Every missing layer, ChatGPT guesses: often in English, with commas. A precise request gives a formula in French, with its semicolons. Request: Excel Microsoft 365 in French. Ventes table: A Date, B Commercial, D Montant HT. Write the formula for the pre-tax total of [sales rep] in October 2026, then explain each argument. Answer: =SOMME.SI.ENS(Ventes[Montant HT];Ventes[Commercial];H2;Ventes[Date];">="&DATE(2026;10;1);Ventes[Date];"<"&DATE(2026;11;1)), then one line of explanation per criterion. Test a formula on three rows whose result you already know. [Diagram: From question to tested formula] 1. Describe 2. Ask 3. Paste into one cell 4. Test three cases 5. Copy down If a test fails, paste the faulty row back into the conversation with the expected result. RECHERCHEX (XLOOKUP) if your Excel has it, otherwise INDEX and EQUIV (MATCH). Microsoft 365 and recent versions: RECHERCHEX Older versions: INDEX and EQUIV #NOM?: the function doesn't exist in your version A macro can't be undone. Test it on a copy of the file. [Diagram: The risk, from formula to macro] Green: Formula Orange: Pivot table Red: Macro The more the tool acts on the data itself, the more testing on a copy becomes compulsory. The pivot table: ChatGPT tells you where to drag each field. Rows, Columns, Values, Filters Dates grouped by month Refresh after each addition In the exercise, you build the tools for Yann's delivery tracking. A tested delay formula A pivot table by carrier A macro run on a copy Your turn: Delivery tracking for a logistics hub The written course, the worked exercise and the quiz are below the video.
Lesson 45 of 54 · module 11, automating what comes back
ChatGPT and Excel: getting formulas, pivot tables and simple macros written
ChatGPT writes the Excel formula you cannot build yourself: RECHERCHEX, SOMME.SI.ENS, NB.SI.ENS, calculating a delay. Tell it your Excel version, the table and its columns, then test the formula on three rows whose result you already know. It also guides you through a pivot table and writes a simple macro, to be tested on a copy of the file.
37 min of reading
1 min 49 of video
7 diagrams
7 demandes to copy
3 exemples pratiques
4 exercices answerss
5 questions
2 ressources
By the end of this lesson, you will know how to
Describe a table to ChatGPT to get a French-language formula that works in your version of Excel
Test a formula on three cases with a known result and have it explained before copying it down
Install and run a simple VBA macro on a copy of the file, with a check before and after
What’s covered
Describe the table before asking
Recurring formulas
Test before copying down
The pivot table
Simple macros, on a copy
3 worked examples, followed from start to finish
Exercise with answers · Delivery tracking at a logistics hub
3 practice exercises, from guided to demanding cases
The quiz
Key points
Describe the table before asking: Excel version, language, table name, columns, three rows with no personal data.
A formula is pasted into one cell and tested on three cases with a known result before it is copied down.
RECHERCHEX when every computer supports it, otherwise INDEX and EQUIV inside a SIERREUR.
A pivot table is built on a named table and refreshed before every reading.
A macro cannot be undone: copy the file, explain it line by line, note the total before and after.
In an SME, Excel holds the price lists, invoicing, delivery tracking and reminders. The sticking point is rarely the data; it is the formula. You know what the column should calculate (the item’s price in the price list, a salesperson’s total for the month, the number of overdue invoices), but not how to write it. ChatGPT writes that formula in seconds, provided you describe the file as precisely as you would to a colleague who has never opened it.
The lesson “Analysing an Excel table without formulas” had ChatGPT do the calculations on your file. Here, it writes what lives inside the file: a formula that recalculates every month, a pivot table that management refreshes, a macro that repeats the same clean-up every Monday. The file stays on your computer, and your colleagues can read, check and correct what has been written.
Describe the table before asking
What ChatGPT needs to know about the table
Your Excel
The version (Microsoft 365, 2016…) and the language: they determine the functions and separators.
The table
Its name, its sheet, the header row. A named table gives readable formulas.
Columns
The letter and exact header of each relevant column, with its type: date, text, number.
Three example rows
Altered values, with no client names or personal data.
The expected result
Where the formula goes, what it displays, and what to do when nothing is found.
Every missing layer, ChatGPT guesses: often in English, with commas.
The formula request template
I work in French-language Excel [Microsoft 365, 2021, 2019 or 2016] on [Windows or Mac].
My table is called [table name], on sheet [sheet name], headers in row 1.
Columns: A [exact header] ([date, text or number]), B [exact header] ([type]), C [exact header] ([type]), [other useful columns].
Three sample rows, values altered: [row 1]; [row 2]; [row 3].
Task: write the formula to put in [cell or column] that [what it must calculate]. If [the case where nothing is found], it shows [a text or 0].
Format: the formula with French function names and semicolons, then an explanation of each argument, then three test rows with the expected result, including an edge case. If my version doesn’t have a function, suggest a formula that works in my version.
Roughly what you should get
A one-line formula, in French, with semicolons and your column names, followed by four to six lines of explanation and three test cases with figures to redo in your file.
Keep this template in your prompt library: only the brackets change from one file to the next.
Recurring formulas
Five SME formulas, in French Excel
Need
Plan
What it does
The price of a product reference in the price list
Zero if the invoice is paid or not yet due, otherwise the number of days since the due date.
RECHERCHEX exists in Microsoft 365, in Excel 2021 and later versions, and in Excel for the web. In Excel 2016 or 2019, the cell shows #NOM?: the function does not exist. If even one recipient of the file has an older version, use INDEX and EQUIV. Two other pitfalls come up often. Unless told otherwise, ChatGPT may answer with the English names (XLOOKUP, SUMIFS) and commas, whereas French-language Excel expects RECHERCHEX, SOMME.SI.ENS and semicolons. And it readily writes fixed ranges such as A2:A500, which ignore rows added later. Format your data as a named table: formulas then refer to columns, such as Tarifs[Prix HT], which follow the table as it grows.
RECHERCHEX or INDEX and EQUIV
1Is your Excel Microsoft 365, or version 2021 or later?
No Ask for INDEX and EQUIV inside SIERREUR: the formula works in every version.
2Does everyone who will open the file also have a recent version?
No Stick with INDEX and MATCH: XLOOKUP would show #NAME? on their machines.
3Is the lookup value unique in the lookup column?
No First remove the duplicates from the price list, then come back to this question.
Yes to allUse RECHERCHEX, with its fourth argument for the “nothing found” case.
Both formulas return the first row found: a duplicate in the price list skews both.
Test before copying down
From question to tested formula
1Describe
Version, table, columns, three rows
2Ask
The formula in French, with its explanation
3Paste into one cell
One cell first, not the whole column
4Test three cases
A normal case, a missing case, an edge case
5Copy across
Across the whole column, then a total checked against the source
If a test fails, paste the faulty line back into the conversation with the expected result.
Getting a formula explained and stress-tested
Here is a formula from a [department] workbook that I have to take over: [paste the formula].
The columns it uses: [letters and headers].
Task: explain what it calculates, argument by argument, in plain words. Tell me in which cases it gives a wrong result or an error: empty cell, text instead of a number, date at the edge of a period, duplicate, extra space. Suggest a more readable version if there is one, compatible with Excel [version] in French.
Format: the explanation as a list, then a table of risk cases (case, what happens, how to test it in the file).
Roughly what you should get
An explanation in five to eight points, then a table of four to six risk cases, each with the test row to create in the file and the result it should give.
The test that matters most is the edge case: the last day of the month, a missing product code, an empty row. It is the calculation check from the lesson “Checking an answer in four checks”, applied to a formula.
The pivot table
Build a pivot table on a named table
Click in a cell of your data, then Home › Format as Table. Check that “My table has headers” is ticked.
Name the table in the Table Design tab, Table Name box (the label may vary slightly by version): Sales rather than Table1.
Still in the table, Insert › PivotTable, then New Worksheet, and OK.
In the fields pane, drag each field into Rows, Columns, Values or Filters, as ChatGPT told you.
For an average or a count instead of a sum, click the field in Values, then Value Field Settings, and choose the calculation.
After adding rows to the source table, right-click in the PivotTable, then Refresh.
Where to place each field in the pivot table
My table [table name] contains the columns [list of exact headers]. Excel [version] in French.
I want a PivotTable that answers this question: [the question, for example: what revenue excl. VAT per sales rep and per month, for the wine merchants channel only].
Task: tell me which fields to put in Rows, Columns, Values and Filters, which calculation to choose for the values (sum, count, average), and whether to group the dates.
Format: a numbered list of clicks, then the check to carry out to verify the grand total against the source table.
Roughly what you should get
A list of five to eight clicks, one field per area, how values are calculated, dates grouped by month, then a formula to check the total, placed next to the source table.
Simple macros, on a copy
Install and run a macro
Turn on the Developer tab once and for all: File › Options › Customize Ribbon, tick Developer, then OK (the wording may vary slightly by version).
Open the copy of the file, then the VBA editor with Alt+F11, or Developer › Visual Basic.
In the editor, Insert › Module: a blank page opens.
Paste the code ChatGPT gave you, from the Sub line to End Sub, then close the editor.
Save as the Excel Macro-Enabled Workbook type (.xlsm): a .xlsx file loses its macros when saved.
Run the macro with Alt+F8, or Developer › Macros: select it in the list, then Run.
The macro request template
I don’t know VBA. French-language Excel [version] on Windows.
Sheet [sheet name], headers in row 1, columns [A to …, with their exact headers], about [number] rows.
Task: write a VBA macro that [what it must do, step by step].
Constraints: comment each block in French; don’t delete or overwrite anything without a confirmation box showing the sheet name; if rows need deleting, loop through them from bottom to top; don’t use Select or Activate; at the end, show a message saying what was done, with the number of rows processed.
Format: the complete code between Sub and End Sub, then a line-by-line explanation, then how to install and run it, then a list of what could go wrong.
Roughly what you should get
Fifteen to forty lines of code, commented in French, with a confirmation before any deletion and a final message, followed by a line-by-line explanation and three or four risks to test on the copy.
When deleting rows, always ask for a “bottom-to-top loop”: going downwards, each deletion makes the loop skip the next row.The risk, from formula to macro
Plan
Can be read in the formula bar and corrected
Ctrl+Z undoes a botched copy-down
Recalculates itself every month
PivotTable
Doesn’t change until you refresh it
A total to reconcile with the source
Doesn’t alter the original data
Macro
Acts on the data, with no Ctrl+Z
A copy of the file before each trial
Never a macro you cannot explain
The more the tool acts on the data itself, the more testing on a copy becomes mandatory.
Excel for the web does not run VBA macros; its automation tool, Office Scripts on the Automate tab, depends on your Microsoft 365 subscription. Google Sheets does not run VBA either: it has its own language, Apps Script. The method stays the same: describe the file, ask for commented code, test it on a copy. For most SME needs, a well-tested formula or a pivot table is enough. Keep macros for a clean-up or export that recurs every week, identically.
Mistakes to avoid
Asking for “the formula to find the price in the price list”, without saying anything about the file.
ChatGPT guesses the columns, the version and the language. It may give you a formula in English with commas, or an XLOOKUP that your Excel 2016 does not recognise: #NAME? appears, or worse, a price taken from the wrong column.
Give the five layers: version and language, table name, columns with their letters and headers, three sample rows, expected result and the “nothing found” case.
Paste the formula at the top of the column and copy it down 2,000 rows without testing.
A formula can run without an error and give a wrong result: an approximate match instead of an exact one, a month that loses its last day, a reference that shifts. Nothing shows up in red.
Paste it into a single cell, test three cases whose result you know (ordinary, missing, borderline), then copy it down and reconcile a total with the source.
Running a new macro on the working file, relying on Ctrl+Z.
Ctrl+Z does not undo what a macro has done. Rows deleted by mistake, a column overwritten: if the file has been saved, it is lost.
A dated copy of the file for each trial, a total noted before and after, and three successful runs on a copy before any use on the real file.
Build the pivot table on a range A1:F500 and never refresh it.
Rows added after row 500 are not counted, and the pivot table keeps the figures from the day it was created. Management reads a wrong total, neatly presented.
First format the data as a named table, build the PivotTable on that table, and refresh it before each reading (right-click, Refresh).
3 SME situations followed from start to finish: the prompts exactly as they were written, the model answer to aim for, and what was checked before sending.
Example 1
The 2027 list price in each order, in Excel 2016
Sophie is a management controller at a 40-employee wine merchant in Libourne. Every week, she copies by hand the price from the 2027 price list into the orders entered by the sales team, around 300 lines. Two computers in the department still run Excel 2016.
The price in orders
1Describe the two tables
Columns, 2016 version, three rows of the price list
2INDEX and MATCH
The formula that works on every computer
3Three tests
Present, absent, with an extra space
4Clean the source
Four references corrected in the export
5Copy across and check
Three prices checked by hand against the price list
Request 1
I work in French-language Excel 2016. The workbook contains two named tables.
Table Commandes: A Référence, B Désignation, C Quantité, D Prix HT (to fill in), E Total HT.
Table Tarifs: A Référence, B Désignation, C Prix HT 2027.
Three rows from Tarifs: BX-1204 | Saint-Émilion grand cru 75 cl | 18.40; PM-0310 | Pomerol 75 cl | 32.00; FR-0088 | Fronsac 75 cl | 9.90.
Task: write the formula for column D of Commandes, which looks up the 2027 price excl. VAT for the row’s reference. If the reference isn’t in the price list, the cell shows “À vérifier”.
Format: the formula in French with semicolons, then an explanation, argument by argument.
Model answer
Excel 2016 does not have RECHERCHEX. Here is the formula to put in D2 of the Commandes table:
=SIERREUR(INDEX(Tarifs[Prix HT 2027];EQUIV([@Référence];Tarifs[Référence];0));"À vérifier")
What it does:
- EQUIV([@Référence];Tarifs[Référence];0) looks for the position of the row’s reference in the Référence column of the price list. The 0 forces an exact match.
- INDEX(Tarifs[Prix HT 2027];…) returns the price at that position.
- SIERREUR(…;"À vérifier") displays “À vérifier” (“to be checked”) when the reference is not in the price list, instead of the #N/A error.
As Commandes is a table, the formula fills the whole of column D automatically as soon as you confirm the first cell.
Sophie keeps the formula as it is. She notes in the file, as a comment on cell D1, that the column uses INDEX and MATCH because of the two computers running Excel 2016.
Request 2
Also give me the RECHERCHEX version, for the day the whole department is on Microsoft 365, and three test cases to try in the file.
Model answer
Microsoft 365 version:
=RECHERCHEX([@Référence];Tarifs[Référence];Tarifs[Prix HT 2027];"À vérifier")
Three tests:
1. A reference that is in the price list, for example BX-1204: the cell should show 18.40, as in the price list.
2. A reference that is missing: type ZZZ-000. The cell should show “À vérifier”.
3. A reference followed by a space: type “BX-1204” then a space. The formula shows “À vérifier”, because Excel treats the two texts as different. If your software exports extra spaces, clean the column with SUPPRESPACE, or look up SUPPRESPACE([@Référence]) instead of [@Référence].
Test 3 reveals four product codes exported with a trailing space. She cleans them up in the source rather than complicating the formula.
What was checked before sending
Calculations: three prices looked up by hand in the price list, including those of the first and last product codes.
Facts: the Excel version on each computer checked under File › Account before choosing the formula.
The edge case: references with an extra space, caught by test 3 and corrected in the source.
An hour of manual copying each week becomes ten minutes of checking, as a rough estimate.
Example 2
The monthly summary of billable hours by client
Amandine is an accountant at an 80-employee digital services company in Bordeaux Lac. At the start of each month, she prepares time-based billing: she filters the consultants’ entries client by client and adds up the billable hours, two hours of manual work. The whole department uses Microsoft 365.
Time-based billing
Before
A filter by client, fifteen times in a row
Sums copied out by hand
No check on the total
After
A formula copied down for the whole year
A pivot table for management
Two totals that must match
Request 1
Microsoft 365 Excel in French.
Temps table (Saisies sheet), headers in row 1: A Date, B Consultant, C Client, D Projet, E Heures, F Facturable (Oui or Non).
Synthèse sheet: clients in A2:A15, and in row 1, from B1 onwards, the first day of each month (01/10/2026, 01/11/2026…).
Task: write the formula for B2, to be copied right and down, that adds up the billable hours for the row’s client in the column’s month.
Format: the formula, an explanation of each criterion, then how to copy it without breaking the references.
Model answer
Formula to enter in B2:
=SUMIFS(Temps[[Heures]:[Heures]],Temps[[Client]:[Client]],$A2,Temps[[Facturable]:[Facturable]],"Oui",Temps[[Date]:[Date]],">="&B$1,Temps[[Date]:[Date]],"<"&EDATE(B$1,1))
What each criterion does:
- Temps[[Heures]:[Heures]] is the column being summed.
- $A2 is the client on that row; the $ locks column A when you fill to the right.
- "Oui" on the Facturable column: only billable hours count.
- ">="&B$1 and "<"&EDATE(B$1,1) set the period, from the first day of the month (included) to the first day of the following month (excluded). 31 October counts in October, 1 November in November.
Why the double brackets: when filled to the right with the fill handle, a reference such as Temps[Heures] shifts to the next column of the table. Written as Temps[[Heures]:[Heures]], it stays fixed. Then fill B2 to the right as far as the last month, and the whole row down.
Amandine pastes the formula into B2, copies it down to M15 for the year, and first checks a client whose October total she knows by heart.
Request 2
I want the same summary as a pivot table, for management. Tell me step by step where to place each field and how to group the dates by month. Also tell me how to check that the pivot table and my formula give the same total.
Model answer
1. Click in the Temps table, then Insert › PivotTable, on a new sheet.
2. Drag Client to Rows, Date to Columns, Heures to Values (Sum of Heures), Facturable to Filters.
3. In the Facturable filter, keep only Oui.
4. If the dates aren’t grouped automatically, right-click a date in the header, Group, then Months and Years.
5. Check: the October grand total must equal the sum of column B in your summary, =SOMME(B2:B15). A discrepancy usually comes from a client entered in two different ways.
6. After adding the following month’s entries: right-click in the PivotTable, Refresh.
The reconciliation shows a 3.5-hour gap: the same client entered under two names, with and without “SAS”. Amandine corrects the entries, adds the missing client to the summary, and the two totals match.
What was checked before sending
Calculations: the pivot table total reconciled with the formula total, month by month.
The edge case: an entry dated 31 October counted in October, one dated 1 November counted in November.
Facts: the list of clients in the summary compared with the names actually entered, to spot spelling duplicates.
Two hours of filters and sums at the start of each month become a quarter of an hour of refreshing and reconciling, as an order of magnitude.
Example 3
Cleaning the sales export, every Monday
Patrick manages a 12-employee trade hardware business in Cenon. Every Monday he exports the week’s sales from his management software to Excel: about 600 rows, with blank rows between days and stray spaces in front of the product descriptions. Cleaning it up by hand takes him twenty minutes.
Patrick’s Monday
8 hSales export
The week’s file comes out of the management software.
8 h 02Total noted
The total of the Montant HT column, noted before anything else.
8 h 03Macro run
Alt+F8, NettoyerExport, sheet name read in the confirmation.
8 h 04Totals compared
Amount excl. VAT before and after: identical. The file goes on for analysis.
Request 1
I don’t know VBA. French-language Excel Microsoft 365 on Windows.
Every Monday, I open the sales export from my management software in Excel: sheet Export, headers in row 1, columns A to H (A Date, B N° de ticket, C Désignation, D Quantité, E Prix unitaire HT, F Montant HT, G Vendeur, H Mode de paiement), about 600 rows.
Task: write a macro that deletes the rows where column A is empty, then removes extra spaces in column C.
Constraints: comment each block in French; ask for confirmation showing the sheet name; loop through rows from bottom to top when deleting; at the end, show the number of rows deleted.
Format: the complete code, then how to install it and run it on each Monday’s export.
Model answer
Sub NettoyerExport()
' Cleans the active sheet.
' 1. Deletes rows where column A is empty.
' 2. Removes extra spaces in column C.
' Run it on a copy of the file. A macro cannot be undone with Ctrl+Z.
Dim ws As Worksheet
Dim derniere As Long
Dim i As Long
Dim supprimees As Long
Set ws = ActiveSheet
If MsgBox("Clean the sheet " & ws.Name & " (empty rows deleted, spaces removed). Yes to run, No to cancel.", vbYesNo + vbQuestion) = vbNo Then Exit Sub
' Empty rows, from the last used row up to row 2.
derniere = ws.UsedRange.Row + ws.UsedRange.Rows.Count - 1
For i = derniere To 2 Step -1
If Len(Trim(ws.Cells(i, "A").Text)) = 0 Then
ws.Rows(i).Delete
supprimees = supprimees + 1
End If
Next i
' Extra spaces in the product descriptions (column C).
derniere = ws.Cells(ws.Rows.Count, "A").End(xlUp).Row
For i = 2 To derniere
If Not IsError(ws.Cells(i, "C").Value) Then
ws.Cells(i, "C").Value = Application.WorksheetFunction.Trim(ws.Cells(i, "C").Value)
End If
Next i
MsgBox supprimees & " empty row(s) deleted. Descriptions cleaned."
End Sub
To install it once and for all: create a workbook called Outils-ventes.xlsm, open the editor with Alt+F11, Insert › Module, paste the code and save. Every Monday: open Outils-ventes.xlsm, then the export; display the Export sheet, press Alt+F8, choose NettoyerExport and click Run. The macro works on the sheet on screen, whichever workbook it is in.
Patrick stores the macro in the Outils-ventes.xlsm workbook: the export itself stays a plain file that he doesn’t need to save as .xlsm.
Request 2
Explain line by line what this macro does, and tell me what happens if I run it on the wrong sheet.
Model answer
Line by line:
- Set ws = ActiveSheet: the macro works on the sheet displayed when it is run.
- MsgBox … vbYesNo: the confirmation window shows the sheet name. If it is not Export, answer No.
- The first loop starts from the last used row and works up to row 2: going down, each deletion would skip the next row.
- Len(Trim(….Text)) = 0 detects a cell in column A that is empty or contains only spaces.
- The second loop applies Excel’s TRIM function (Trim in VBA) to each description in column C, except cells showing an error.
- The final message gives the number of rows deleted.
On the wrong sheet: the macro would delete every row where column A is empty, such as the subtotal rows of another table, and would rewrite column C. Ctrl+Z will not bring them back. Hence the confirmation, and testing on a copy.
Patrick reads the explanation before running it for the first time. He remembers the rule: he reads the sheet name in the dialog box before clicking Yes.
What was checked before sending
Calculations: the total of the Amount excl. VAT column noted before and after the macro, identical to the cent.
Facts: the number of rows after cleaning compared with the number of tickets the management software shows for the week.
Three Mondays in a row, the macro run on a copy of the export before it is used on the day’s file.
Twenty minutes of clean-up every Monday becomes two minutes, macro and check included, once the three trial runs are done.
You are Yann, logistics manager at a 30-employee distribution platform in Saint-Jean-d’Illac. Delivery tracking is kept in an Excel workbook (Microsoft 365, in French) called Livraisons, on the sheet of the same name: A Commande (order), B Date prévue (planned date), C Date livrée (delivered date, empty until the delivery has taken place), D Transporteur (carrier), E Département, F Retard (delay, to be created). Every Friday, management wants the number of late deliveries per carrier, a pivot table of average delays by month and the list of late deliveries. Have ChatGPT write the formula, the summary, the pivot table plan and the macro, and test each piece on a copy of the file.
Describe the table to ChatGPT: version, language, name, columns, three rows with altered values.
Have it write the formula for the Late column and test it on four cases: delivered on time, delivered late, not yet delivered and overdue, due tomorrow.
Have it write the COUNTIFS formula for the number of late deliveries per carrier, on a Summary sheet.
Have it set out the layout of the pivot table: average delay by carrier and by month.
Have it write the macro that copies late deliveries to a Late sheet, run it on a copy and count the rows.
I work in French-language Excel Microsoft 365 on Windows.
Table Livraisons, sheet Livraisons, headers in row 1: A Commande (text), B Date prévue (date), C Date livrée (date, empty until delivery has taken place), D Transporteur (text), E Département (number), F Retard (to be created).
Three sample rows, values altered: CMD-5512 | 03/11/2026 | 03/11/2026 | Transporteur A | 33; CMD-5513 | 04/11/2026 | 07/11/2026 | Transporteur B | 40; CMD-5514 | 05/11/2026 | (empty) | Transporteur A | 24.
Task: write the formula for column F, the delay in days. Delivery made: delivery date minus planned date, never negative. Delivery not yet made: today’s date minus planned date, never negative.
Format: the formula in French with semicolons, its explanation, and four test cases with the expected result, including a delivery planned for tomorrow.
Roughly what you should get
An IF (SI) formula that tests whether the delivery date is empty (ISBLANK, ESTVIDE), with two MAX(0;…) so a delay is never negative, then four test cases with figures.
The four tests for the Retard column
Case
Planned date
Delivery date
Expected delay
Delivered on the planned day
03/11/2026
03/11/2026
0
Delivered three days late
04/11/2026
07/11/2026
3
Not yet delivered, due two days ago
Today’s date minus 2
Empty
2
Not yet delivered, due tomorrow
Today’s date plus 1
Empty
0
The formula for F: =SI(ESTVIDE([@[Date livrée]]);MAX(0;AUJOURDHUI()-[@[Date prévue]]);MAX(0;[@[Date livrée]]-[@[Date prévue]])). The double brackets surround headers that contain a space. If the column shows a date instead of a number, switch it to General format. On the Synthèse sheet, put the carriers in A2 to A5 and, in B2, =NB.SI.ENS(Livraisons[Transporteur];$A2;Livraisons[Retard];">0"), copied down. The total of column B must equal the number of rows shown by a “Retard greater than 0” filter on the table.
Rows: Carrier. Columns: Planned date, grouped by Month.
Values: Retard, as Average (Value Field Settings), and Commande, as Count.
Every Friday: right-click, Refresh, then check the number of orders against the number of rows in the source table.
The request for the macro
I don’t know VBA. French-language Excel Microsoft 365 on Windows.
Sheet Livraisons, headers in row 1, columns A to F (Commande, Date prévue, Date livrée, Transporteur, Département, Retard), about 400 rows.
Task: write a macro that recreates a Retards sheet, placed after Livraisons, and copies into it the headers, then the values of the rows where column F is greater than 0. If the Retards sheet already exists, it is deleted and recreated. The Livraisons sheet is never changed.
Constraints: comment each block in French; ignore cells in column F that contain errors or text; don’t use Select or Activate; at the end, show the number of rows copied.
Format: the complete code, then a line-by-line explanation.
Roughly what you should get
A macro of about forty lines: a loop that deletes the old Retards sheet, creation of the new one, a loop that copies the overdue rows, a closing message, then an explanation of each block.
The code to paste into a module
Sub ListerRetards()
' Copies to the Retards sheet the deliveries whose column F (Retard, i.e. delay) exceeds 0 days.
' Run it on a copy of the file. A macro cannot be undone with Ctrl+Z.
Dim src As Worksheet
Dim dst As Worksheet
Dim f As Worksheet
Dim v As Variant
Dim derniere As Long
Dim i As Long
Dim ligne As Long
Set src = ThisWorkbook.Worksheets("Livraisons")
' Deletes the old Retards sheet, if it exists.
For Each f In ThisWorkbook.Worksheets
If f.Name = "Retards" Then
Application.DisplayAlerts = False
f.Delete
Application.DisplayAlerts = True
Exit For
End If
Next f
' Creates the Retards sheet and copies the headers into it.
Set dst = ThisWorkbook.Worksheets.Add(After:=src)
dst.Name = "Retards"
dst.Range("A1:F1").Value = src.Range("A1:F1").Value
' Copies the values of late rows, ignoring errors and text.
ligne = 2
derniere = src.Cells(src.Rows.Count, "A").End(xlUp).Row
For i = 2 To derniere
v = src.Cells(i, "F").Value
If Not IsError(v) Then
If IsNumeric(v) Then
If v > 0 Then
dst.Range("A" & ligne & ":F" & ligne).Value = src.Range("A" & i & ":F" & i).Value
ligne = ligne + 1
End If
End If
End If
Next i
dst.Columns("A:F").AutoFit
MsgBox CStr(ligne - 2) & " late delivery(ies) copied to the Retards sheet."
End Sub
This block is not a request to ChatGPT: it is the code to paste into the VBA editor (Alt+F11, Insert › Module), in a workbook saved as .xlsm.
Practise
Three more exercises, from the most guided to the most demanding. The material is provided in full: copy it into your tool, then check your work against the criteria before opening the answers.
Level 1 · guided10 min
Count open repair jobs per technician
Write the request that gets ChatGPT to produce the formula for cell I2, to be copied down to I4: the number of call-outs still open for the technician named in H2. Paste the formula into your own file filled in with the material provided, then check the three results by hand.
The material to work on
“Interventions” (Call-outs) table (Excel Microsoft 365, French version), Suivi sheet, headers in row 1:
A Date | B Technician | C Type | D Duration (h) | E Status
03/11/2026 | T1 | Repair | 1.5 | Closed
03/11/2026 | T2 | Maintenance | 2 | Closed
04/11/2026 | T2 | Repair | 1 | Open
04/11/2026 | T3 | Repair | 3 | Open
05/11/2026 | T1 | Maintenance | 1.5 | Open
05/11/2026 | T2 | Repair | 2.5 | Open
06/11/2026 | T3 | Maintenance | 1 | Closed
06/11/2026 | T2 | Repair | 0.5 | Closed
07/11/2026 | T1 | Repair | 2 | Open
Cells H2, H3 and H4: T1, T2, T3.
Check your work
The request gives the Excel version and language.
She names the table Interventions and the columns Technicien, Type and Statut.
It says where the formula goes (I2) and that it is copied down.
The resulting formula uses NB.SI.ENS with three range and criterion pairs, separated by semicolons.
The results are 1 for T1, 2 for T2 and 1 for T3.
See the answers
The expected request
I work in French-language Excel Microsoft 365.
Table Interventions, sheet Suivi, headers in row 1: A Date, B Technicien, C Type (Dépannage or Entretien), D Durée (h), E Statut (Ouverte or Clôturée).
Three sample rows: 04/11/2026 | T2 | Dépannage | 1 | Ouverte; 06/11/2026 | T3 | Entretien | 1 | Clôturée; 07/11/2026 | T1 | Dépannage | 2 | Ouverte.
In H2, H3 and H4, the technician codes: T1, T2, T3.
Task: write the formula for I2, to be copied down to I4, that counts the still-open repair call-outs for the technician in column H.
Format: the formula in French with semicolons, then an explanation of each criterion.
Roughly what you should get
The formula =NB.SI.ENS(Interventions[Technicien];H2;Interventions[Type];"Dépannage";Interventions[Statut];"Ouverte"), followed by three lines of explanation, one per range and criterion pair.
On the handout, the results are 1 for T1 (07/11), 2 for T2 (04/11 and 05/11) and 1 for T3 (04/11). T2’s repair call-out on 06/11 is closed, so it does not count. If you get 3 for T2, the Status criterion is missing. Count by hand before trusting the formula: that is how you check the calculations.
Level 2 · independent20 min
Days overdue and outstanding overdue amount on an invoice statement
You keep track of invoices for a 15-employee maintenance company in Bègles. Have ChatGPT write three formulas: the Retard (jours) (days overdue) column, the number of overdue unpaid invoices and their total amount. So that your tests don’t change from one day to the next, the reference date is in cell J1; you will replace it with AUJOURDHUI() once the tests pass. Copy the material into a workbook and check each result.
The material to work on
“Factures” (Invoices) table (Excel Microsoft 365, French version), headers in row 1:
A No. | B Client | C Amount incl. VAT | D Due date | E Status | F Days overdue (to be created)
F-1041 | Client A | 1,200 | 15/10/2026 | Paid
F-1042 | Client B | 850 | 20/10/2026 | Unpaid
F-1043 | Client C | 2,400 | 31/10/2026 | Unpaid
F-1044 | Client A | 600 | 05/11/2026 | Unpaid
F-1045 | Client D | 1,750 | 14/11/2026 | Paid
F-1046 | Client B | 3,100 | 30/11/2026 | Unpaid
F-1047 | Client E | 480 | 10/11/2026 | Unpaid
F-1048 | Client C | 920 | 15/11/2026 | Unpaid
Cell J1, outside the table: 15/11/2026 (reference date).
Cell J3: number of overdue unpaid invoices. Cell J4: their total amount incl. VAT.
Check your work
The request specifies that J1 contains the reference date and that a paid invoice has zero days overdue.
The delay formula returns 26 for F-1042, 0 for F-1046 (due date still to come) and 0 for F-1048 (due the same day).
The number of overdue unpaid invoices is 4.
Their total amount is €4,330.
The formulas use the columns of the Factures table, not fixed ranges.
See the answers
The expected request
I work in French-language Excel Microsoft 365.
Table Factures, headers in row 1: A N°, B Client, C Montant TTC, D Échéance (date), E Statut (Payée or Non payée), F Retard (jours), to be created.
Cell J1, outside the table, contains the reference date: 15/11/2026.
Task: write three formulas.
1. Column F: the number of days overdue. A paid invoice has 0 days; an invoice whose due date hasn’t passed has 0 days.
2. In J3: the number of unpaid invoices whose due date is before J1.
3. In J4: the total amount incl. VAT of those invoices.
Format: each formula in French with semicolons, its explanation, and the expected result on these three rows: F-1042 | Client B | 850 | 20/10/2026 | Non payée; F-1046 | Client B | 3,100 | 30/11/2026 | Non payée; F-1048 | Client C | 920 | 15/11/2026 | Non payée.
Roughly what you should get
Three short formulas: an IF (SI) with MAX for the Delay column, a COUNTIFS (NB.SI.ENS) and a SUMIFS (SOMME.SI.ENS) on two criteria (Status, and Due date before J1), each followed by two or three lines of explanation and the expected results: 26, 0 and 0 days.
The expected Retard column
No.
Delay (days)
Why
F-1041
0
Paid
F-1042
26
Due 20/10, unpaid
F-1043
15
Due 31/10, unpaid
F-1044
10
Due 05/11, unpaid
F-1045
0
Paid
F-1046
0
Due 30/11, not yet reached
F-1047
5
Due 10/11, unpaid
F-1048
0
Due today: not yet overdue
The formulas: =SI([@Statut]="Payée";0;MAX(0;$J$1-[@Échéance])) for the Retard column; =NB.SI.ENS(Factures[Statut];"Non payée";Factures[Échéance];"<"&$J$1) in J3, which returns 4; =SOMME.SI.ENS(Factures[Montant TTC];Factures[Statut];"Non payée";Factures[Échéance];"<"&$J$1) in J4, which returns 4,330 (850 + 2,400 + 600 + 480). The “strictly less than” sign leaves F-1048 out of the count. If the Retard column shows dates, switch it to General format. Once the tests pass, replace $J$1 with AUJOURDHUI() in all three formulas.
Level 3 · demanding case35 min
A distributor’s monthly reporting, from formula to PDF
You are an executive assistant at a 25-employee wine and spirits distributor in Mérignac. Every month the managing director wants a summary of sales by sales rep and by month, a pivot table by channel, and the summary as a PDF in the workbook’s folder. Have ChatGPT write: the formula for cell B2 of the summary, which can be copied right and down; the layout of the pivot table by channel; a macro that exports the Synthèse sheet to PDF. Copy the material into a workbook, check every total, and run the macro on a copy.
The material to work on
“Ventes” (Sales) table (Excel Microsoft 365, French version), Ventes sheet, headers in row 1:
A Date | B Sales rep | C Channel | D Appellation | E Amount excl. VAT
02/10/2026 | C1 | Wine shops | Saint-Émilion | 1,840
09/10/2026 | C2 | Restaurants | Pomerol | 2,300
15/10/2026 | C1 | Restaurants | Lalande-de-Pomerol | 960
22/10/2026 | C3 | Export | Saint-Émilion | 4,100
31/10/2026 | C2 | Wine shops | Fronsac | 720
03/11/2026 | C1 | Wine shops | Pomerol | 1,500
06/11/2026 | C3 | Restaurants | Saint-Émilion | 1,180
12/11/2026 | C2 | Export | Pomerol | 3,650
“Synthèse” (Summary) sheet:
A2, A3, A4: C1, C2, C3
B1: 01/10/2026; C1: 01/11/2026 (first day of each month)
B2 to C4: the totals to calculate.
Check your work
The formula in B2 copies across to C4 without any changes and returns 2,800 for C1 in October and 3,650 for C2 in November.
The sale of 31/10/2026 (720) is counted in October, not November.
The six summary cells total 16,250, equal to the total of the Amount excl. VAT column.
The pivot table by channel gives the same grand total.
The macro stops with a message if the workbook has never been saved, and was first run on a copy.
No real client data was pasted into ChatGPT: only the headers and the course material.
See the answers
The request for the summary formula
I work in French-language Excel Microsoft 365.
Table Ventes, sheet Ventes, headers in row 1: A Date, B Commercial (C1, C2, C3), C Canal (Cavistes, Restaurants, Export), D Appellation, E Montant HT.
Sheet Synthèse: in A2 to A4, the sales reps’ codes; B1 contains 01/10/2026 and C1 contains 01/11/2026, the first day of each month.
Task: write the formula for B2 that adds up the amount excl. VAT for the row’s sales rep for the column’s month, from the first day inclusive to the first day of the following month exclusive. It must copy right and down with the fill handle without the table columns shifting.
Format: the formula in French with semicolons, then an explanation of the $ signs and the double square brackets.
Roughly what you should get
A SOMME.SI.ENS formula on Ventes[[Montant HT]:[Montant HT]], with $A2 for the sales rep, B$1 and MOIS.DECALER(B$1;1) for the start and end of the month, followed by an explanation of the locked references.
The expected formula: =SOMME.SI.ENS(Ventes[[Montant HT]:[Montant HT]];Ventes[[Commercial]:[Commercial]];$A2;Ventes[[Date]:[Date]];">="&B$1;Ventes[[Date]:[Date]];"<"&MOIS.DECALER(B$1;1)). October results: 2,800 (C1), 3,020 (C2), 4,100 (C3). November: 1,500 (C1), 3,650 (C2), 1,180 (C3). Total: 16,250, matching the Montant HT column. If C2 shows 2,300 for October, the sale of 31/10 has been lost: the end boundary is set wrongly.
PivotTable: Channel in Rows, Date in Columns grouped by Month, Sum of Amount excl. VAT in Values.
Grand total: 16,250, as in the summary. A discrepancy points to a channel spelt two different ways in the source.
The request for the export macro
I don’t know VBA. French-language Excel Microsoft 365 on Windows.
Task: write a macro that saves the Synthèse sheet as a PDF, in the same folder as the workbook, named Synthese-AAAA-MM.pdf (current year and month).
Constraints: if the workbook has never been saved, the macro stops with a message; comment each block in French; at the end, show the path of the PDF.
Format: the complete code, then how to install and run it.
Roughly what you should get
A macro of about fifteen lines: a check on the workbook’s folder, building the file name, export via ExportAsFixedFormat and a closing message, followed by the installation steps.
The code to paste into a module
Sub ExporterSynthesePDF()
' Saves the Synthèse sheet as a PDF in the workbook's folder.
' Test on a copy of the file.
Dim chemin As String
' The workbook must have been saved at least once.
If ThisWorkbook.Path = "" Then
MsgBox "Save the workbook first, then run the macro again."
Exit Sub
End If
' File name, with the current year and month.
chemin = ThisWorkbook.Path & Application.PathSeparator & "Synthese-" & Format(Date, "yyyy-mm") & ".pdf"
' Export the Synthèse sheet.
ThisWorkbook.Worksheets("Synthèse").ExportAsFixedFormat Type:=xlTypePDF, Filename:=chemin
MsgBox "PDF saved to " & chemin
End Sub
This block is not a request to ChatGPT: it is the code to paste into the VBA editor (Alt+F11, Insert › Module), in a workbook saved as .xlsm. A PDF with the same name already in the folder is overwritten.
5 scenario-based questions. The explanation appears as soon as you answer; the lesson is ticked off in the contents once you reach 80%.
0 answer sur 5
Lesson resources
XLSX
The platform’s Deliveries table
Nearly three hundred deliveries in an Excel table named Livraisons, with a Retard (delay) column to create, for testing the formula, the pivot table and the macro.
A two-page policy for your company, to complete in Word: authorised tools, prohibited data, review, disclosure of use, named contact, training and Article 4 of the AI Act.
Every request to copy from the course, including answers, practical examples and practice exercises, arranged by module and lesson, with filters to find the right one.
For each lesson, the main exercise and the three graded practice exercises with their materials, to do on paper or alongside ChatGPT; all the answers are grouped together at the end.
The course’s practical examples, job by job: the situation, the requests as they were written, the standard replies obtained and what was checked before using them.
The use cases from the twelve job-specific lessons in a filterable table: the lesson, the standard request and the data risk level (green, amber, red) with the precaution to take.
All the lessons in a single PDF: objectives, written course with its diagrams, tables and requests, common mistakes, exercise and key takeaways. The practice exercises and answers are in the workbook, the examples in the collection.
Your notes stay on this device; they are not sent anywhere.
A question for the tutor
A result that doesn’t match the model answer, a prompt that gets you nowhere, a case specific to your business: write to us with your prompt and the response you got. A Bonbay Académie trainer replies within 24 working hours, on your case.