Skip to content
3 role hubs · 7 tasksData privacy

P&L with AI: build one from a trial balance

Map each nominal code to a P&L line once and let SUMIFS build the P&L every month. AI proposes the mapping and writes formulas; Excel does the arithmetic; three checks tie it to the TB.

Difficulty
Intermediate Comfortable with SUMIFS and lookups, or willing to let AI explain them.
Time
About an hour the first time on your own data; minutes each month after (our estimate, not a measured figure)
Tools
Microsoft Excel (365, 2021 or 2019)Claude, ChatGPT or Copilot in Excel
FICTIONAL EXAMPLE COMPANY Northfold Joinery Ltd A fitted-kitchen and bespoke-furniture maker with a workshop team of joiners and a small office. Year ended 31 March 2026 (April 2025 to March 2026). Northfold Joinery Ltd does not exist. The trial balance was generated for this guide (a script) to look like a UK joinery SME: seasonal sales, a fixed workshop payroll, 2025-26 employer NI rates, quarterly VAT. No real company's figures are used.

Computed from the example workbook (fictional company)

Checks 4 of 4 OK
Revenue£1,289,751Year to date
Gross profit£426,40633.1% margin
Overheads£369,267Eight lines
Operating profit£61,966After £4,827 other income
Net profit before tax£50,6833.9% of revenue

The workbook

Trial balance in, P&L out, checks green.

The real example data, sheet by sheet. Every number below is read from the files you can download, and the P&L was evaluated from the workbook's own formulas.

pl-template.xlsx
Profit and loss, year to date, £
£Year to date
Revenue
Fitted kitchens1,043,409
Bespoke furniture246,342
Total revenue1,289,751
Cost of sales
Materials531,552
Subcontract installers87,106
Workshop wages244,688
Total cost of sales863,345
Gross profit426,406
Gross margin %33.1%
Other operating income
Sundry income4,827
Overheads
Staff costs171,934
Premises86,114
Motor29,505
IT and communications6,371
Professional fees6,900
Insurance1,864
Marketing28,900
Depreciation37,680
Total overheads369,267
Operating profit61,966
Finance costs
Loan interest11,283
Net profit before tax50,683
Net margin %3.9%

Gross margin by month

Check 4 · range 30–45% · OK
Aug-25 27.4%Dec-25 28.4%
  • Gross margin %
  • 30% floor of the check range
Gross margin by month, Northfold Joinery Ltd (fictional), Apr-25 to Mar-26
MonthGross margin
Apr-2534.3%
May-2533.1%
Jun-2533.5%
Jul-2532.1%
Aug-2527.4%
Sep-2533.2%
Oct-2534.8%
Nov-2534.3%
Dec-2528.4%
Jan-2633.4%
Feb-2633.7%
Mar-2635.2%
Northfold Joinery Ltd (fictional) profit and loss for the year to March 2026: revenue £1,289,751, gross profit £426,406 at 33.1% gross margin, net profit before tax £50,683, with losses in August and December.Full monthly P&L from the template (PNG)
Monthly summary, £; losses in brackets
£Apr-25May-25Jun-25Jul-25Aug-25Sep-25Oct-25Nov-25Dec-25Jan-26Feb-26Mar-26Year to date
Total revenue112,200111,657110,50495,92380,726114,827125,993122,45483,388101,876107,845122,3591,289,751
Gross profit38,47536,98836,98530,78022,10338,08243,89241,96323,67833,99136,35543,113426,406
Gross margin %34.3%33.1%33.5%32.1%27.4%33.2%34.8%34.3%28.4%33.4%33.7%35.2%33.1%
Net profit before tax5,9025,3505,771298(8,102)7,68911,3788,980(8,624)2,5775,71513,74950,683

The manual

Steps, prompts and checkpoints.

What you’ll end up with

A monthly management P&L in Excel that rebuilds itself from a trial balance export. You decide once which P&L line each nominal code belongs to. After that, a lookup column and SUMIFS do the work every month, and three checks prove the result ties back to the TB.

The split of work is simple. AI proposes the mapping from codes and names only, writes the formulas and drafts the commentary. Excel does all the arithmetic. You make the judgement calls and sign it off.

Before you start

Everything below uses Northfold Joinery Ltd, a fictional fitted-kitchen and bespoke-furniture maker. It does not exist: the trial balance was generated for this guide to look like a UK joinery SME, with seasonal sales, a fixed workshop payroll, 2025-26 employer NI rates and quarterly VAT. Year ended 31 March 2026, 28 nominal codes (21 P&L, 7 balance sheet).

The workbook, the chart and the downloads on this page show the example’s tables, so the steps below give you the numbers to check against rather than repeating them.

Steps

1. Get the trial balance as monthly movements

Export 12 months from your accounting software with nominal code, account name and one column per month. You want movements (what happened in each month), not balances. If your software only gives year-to-date balances, add a sheet that takes each month minus the month before, and keep the first month as it is. Debits positive, credits negative.

Checkpoint: each month column nets to 0.00. The example has 28 codes across 12 months (Apr-25 to Mar-26) and every column balances.

2. Strip it down before AI sees anything

For the mapping you only need two columns: code and account name. Copy them to a new sheet. No amounts, no customer or staff names. If an account name contains a person’s name (some ledgers have “Director’s loan: J Smith”), rename it to something neutral like “Director’s loan account” first.

It feels fussy. It isn’t. The mapping only needs to know what an account is called, never what’s in it.

Checkpoint: a two-column list of 28 rows: codes and names, nothing else.

3. Ask AI to propose the mapping

Give it a fixed list of P&L lines, which stops it inventing lines, and ask it to flag ambiguity, which stops it hiding its guesses.

Prompt

I'm building a management-accounts P&L in Excel for a UK joinery company (fitted kitchens and bespoke furniture).

Below is the chart of accounts: nominal code and account name only, no amounts.

Map every code to exactly one P&L line from this list, and give its section:
- Revenue: Fitted kitchens, Bespoke furniture
- Cost of sales: Materials, Subcontract installers, Workshop wages
- Other operating income: Sundry income
- Overheads: Staff costs, Premises, Motor, IT and communications, Professional fees, Insurance, Marketing, Depreciation
- Finance costs: Loan interest
- Balance sheet: any code that isn't income or expense

Return a table with four columns: Nominal code | Account name | P&L line | Section. One row per code, in code order.
If a code could reasonably go in two places, put your best choice and add a note underneath saying why it's ambiguous. Don't invent codes.

[paste the code and name columns here]

Then read every row. Yes, even the obvious ones. This is the one place where judgement goes in.

Northfold has three judgement calls: sundry income (4900) as revenue or other income; workshop wages (5200) as cost of sales or staff costs; employer’s NI and pension (7006, 7010) split between direct and office staff. We put sundry income below gross profit, workshop wages in cost of sales and all NI and pension in overheads. Any of these is defensible. What matters is that you choose once and keep it, because a P&L that changes shape every month is useless for comparison.

Checkpoint: a table of 28 rows, 7 of them Balance sheet, with notes on the judgement calls.

4. Set up three sheets: TB, Mapping, P&L

Paste the TB with codes in column A and months in C to N. Paste the reviewed mapping onto a Mapping sheet. Then add two helper columns to the TB that look each code up: the P&L line in P and the section in Q. Ask AI for the lookup if you don’t want to write it.

Prompt

In Excel, on a sheet called TB, column A holds nominal codes (numbers) from row 2 down. A sheet called Mapping has code in A, account name in B, P&L line in C and section in D, rows 2 to 500.
Write a formula for TB!P2 that returns the P&L line for the code in A2, returns "UNMAPPED" if the code isn't on Mapping, and returns blank if A2 is empty. Then the same for the section in Q2. Use VLOOKUP or INDEX/MATCH so it works in older Excel. Explain each part in one line.

You should get something like this for the P&L line:

Formula

=IF($A2="","",IFERROR(VLOOKUP($A2,Mapping!$A$2:$D$500,3,FALSE),"UNMAPPED"))

Checkpoint: the formula is filled down to row 500, so next year’s new codes are caught, and filtering column P shows no row saying UNMAPPED.

5. Build the P&L with SUMIFS

Type your P&L line names in column A exactly as they appear on the Mapping sheet. Each number is a SUMIFS over the TB month column, matching the line name. Income lines get a minus sign in front, because credits are negative in the TB and you want revenue to show as a positive number.

Prompt

My P&L sheet has line names in column A (for example "Fitted kitchens") and months across B to M. The TB sheet has monthly movements in C to N (debits positive, credits negative) and the P&L line for each row in column P, rows 2 to 500.
Write the formula for B6 that sums the April column of TB for the line named in A6. Income lines should show as positive, so flip the sign for those. Make the references lock correctly so I can copy it across 12 months and down every line.

For an income line it should look like this:

Formula

=-SUMIFS(TB!C$2:C$500,TB!$P$2:$P$500,$A6)

Checkpoint: April revenue on the example is £112,200 and full-year revenue £1,289,751. If it shows as a negative number, the sign flip is missing.

6. Or do steps 4 and 5 with Copilot in Excel

If your organisation has Copilot in Excel, open the workbook with the TB and Mapping sheets already in place and ask it to add the columns and formulas. If you don’t see Copilot, it may not be in your Microsoft 365 subscription or may not be available under your organisation’s settings.

Prompt

On the TB sheet, add a column called P&L line that looks up each nominal code in column A on the Mapping sheet and returns the P&L line, or UNMAPPED if it isn't there. Then on the P&L sheet, fill B6:M28 with SUMIFS formulas that total the TB month columns by the line name in column A.

Read every formula it writes: click a cell and read the formula bar.

Checkpoint: the same numbers as step 5. If Copilot typed values instead of formulas, undo and ask again for formulas.

7. Add subtotals, gross profit and margins

Add a total for each section, then gross profit (revenue minus cost of sales), gross margin % (gross profit ÷ revenue, wrapped in IFERROR so a month with no revenue doesn’t show an error), operating profit (gross profit plus other operating income, minus overheads), finance costs and net profit before tax. A year-to-date column is just a SUM across the 12 months.

Checkpoint: full year on the example: gross profit £426,406, gross margin 33.1%, overheads £369,267, operating profit £61,966, net profit before tax £50,683 (3.9% of revenue). Gross margin runs from 27.4% (Aug-25) to 35.2% (Mar-26).

8. Add a month and year-to-date view

Put month numbers 1 to 12 above the P&L columns and a month selector on a new sheet. The month column is INDEX on the selected month; year to date is SUMPRODUCT of the months up to and including it.

Formula

=SUMPRODUCT(('P&L'!$B$3:$M$3<=$B$1)*'P&L'!$B8:$M8)

Checkpoint: select month 6 (Sep-25) on the example: revenue £114,827 for the month and £625,836 year to date; net profit £7,689 for the month and £16,908 year to date.

9. Build the checks, then make them pass

Three formula checks on their own sheet, which you look at before anything goes out:

  1. The TB nets to zero in every month.
  2. No code is UNMAPPED.
  3. P&L net profit plus the TB’s total for the non-balance-sheet codes equals zero.

Add a fourth that flags gross margin outside the range you’d expect. Check 3 is the one that earns its place: it’s the only one that proves the P&L ties to the TB rather than just looking plausible.

Checkpoint: all say OK on the example. Then change one mapping row and watch them fail. A check you’ve never seen fail is a check you’re only hoping works.

10. Use AI to review the build and draft the words

Two last prompts. The first reviews your formulas without any data.

Prompt

Here are the formulas from my P&L workbook (no data). Act as a reviewer who has closed a lot of month-ends. List anything that would silently give the wrong answer: ranges that won't extend, sign errors, text matches that could fail, hard-coded numbers. Be specific about cell references.

[paste formulas: use Formulas > Show Formulas, then copy]

The second drafts commentary from the summary figures you choose to give it, and only the reasons you supply. On real data, use your organisation’s approved tool for this step. The figures below are the fictional example’s.

Prompt

Draft four short paragraphs of commentary for a monthly P&L, for the owner of a small joinery business. Plain English, no jargon, no adjectives like 'strong' or 'robust'.
Use only the figures and reasons I give you. If a variance needs a reason I haven't given, write [REASON NEEDED] instead of guessing.

Year to March 2026: revenue £1,289,751, gross profit £426,406 (33.1%), overheads £369,267, net profit before tax £50,683 (3.9%).
Losses in August (-£8,102) and December (-£8,624). Reason: revenue fell to £80,726 and £83,388 while workshop wages stayed around £19,847 a month.
New quoting software from October (£425 a month).

Check every figure in the draft against the sheet before it goes anywhere.

Checkpoint: the commentary explains the August and December losses with the reason you gave and leaves [REASON NEEDED] where you gave none. If it gives a reason you never provided, delete it.

Common mistakes

  • Income showing as negative. A TB holds income as credits, so a plain SUMIFS returns negative revenue: -£1,289,751 on the example. Put a minus in front of the SUMIFS on income lines only, and say which sign convention you use in every prompt.
  • A new code that isn’t mapped. Northfold started paying for quoting software in October on a new code, 7504. A mapping built from April’s TB doesn’t have it, so its £2,550 drops out: IT costs show £318.40 in October instead of £743.40, and net profit is overstated at £53,233. Check 2 shows one unmapped code and check 3 is out by £2,550.00. Fill the lookup down to row 500 and run the UNMAPPED check every month.
  • Line names that nearly match. If one mapping row says “Premises “ with a trailing space, SUMIFS no longer matches it. On the example that drops light, heat and power: premises falls to £62,860 from £86,114. Nothing shows as UNMAPPED, because the code is mapped, so only check 3 catches it (out by £23,253.56). Put a data-validation list on the Mapping sheet’s line column, fed from the P&L’s line names, and keep the tie-back check.
  • Year-to-date balances treated as monthly movements. Many systems export a trial balance as balances at a date. Summed across 12 columns, every line is massively overstated. Difference the columns first, then check a couple of lines against the system’s own monthly P&L.
  • Annual costs posted in one month. Northfold’s insurance (£1,864) hits April only, and its business rates (£11,860) are billed in 10 instalments, April to January, so February and March carry none. The P&L is arithmetically right and still misleading month to month. Spread them with prepayments: £155.33 a month for insurance and £988.33 a month for rates on the example. That’s a journal in the ledger, not something a template can do for you.
  • Accruals that don’t reverse. Northfold accrues its year-end accountancy fee at £575 a month, and when last year’s invoice arrived in December it was posted against the accruals account, so the P&L stayed smooth. Posted straight to the accountancy fees code, December would have taken the full invoice on top of the accrual. Ask of every lumpy line: is this the cost of this month, or the bill for another one?
  • Leading zeros lost. Open a CSV in Excel and code 0051 becomes 51. If your mapping stores codes as text (“0051”), nothing matches. Keep codes as numbers in both sheets with a 0000 number format (the template does), or import the code column as Text in both.
  • Letting AI do the sums. Paste a TB into a chat and ask for a P&L, and you’ll get a tidy table. Some totals may be wrong, and you can’t see how it got them. If a number didn’t come out of a formula, it doesn’t go in the pack.

When to keep AI out of it

Three things stay with you. The arithmetic, always: that’s Excel’s job. The mapping judgement itself: AI proposes, you decide, and calls like Northfold’s workshop wages or sundry income are yours to make and keep. And real figures or client data in a tool your organisation hasn’t approved.

Once the mapping exists, a new month is an export, a paste and a look at the checks. You can see every formula and explain it to anyone who asks.

Downloads

The files, ready to check.

  • Example trial balance (CSV)

    Northfold Joinery Ltd (fictional): 28 nominal codes, monthly movements April 2025 to March 2026, debits positive, credits negative. Every month nets to zero.

    Example data
  • Mapping table (CSV)

    Nominal code to P&L line to section, for every code in the example trial balance.

    Example data
  • P&L template (Excel)

    Working workbook: TB, Mapping, P&L (SUMIFS on the mapping, monthly and year to date, gross margin %), a month view and a Checks sheet. Loaded with the example data; paste your own TB over it.

    Example data
  • P&L preview (PNG)

    The example P&L for the year to March 2026, with losses in August and December.

    Example data

Review checklist: sign off before anyone relies on it

0 of 14
Sign off when every line is ticked.

Confidentiality and UK GDPR

Before you paste anything: green, amber or red.

Before you paste anything, ask two questions: is there personal data in it, and is it confidential to my organisation or a client? If the answer to either is yes, use a tool your organisation has approved, under a business contract, and send only what the task needs.

Green · fine to share

Give it structure, not identities

Codes, headings, layouts, policy wording and your own notes with names taken out are usually enough. Customer names, staff names and bank details almost never are.

Ask for the formula, the template or the draft, not the answer. A formula you can test or a draft you can edit is checkable. A total typed back into a chat window is not.

Amber · approved tools only

Real data goes in an approved business tier

If it is your organisation's or a client's information, use the tool your organisation has approved, under its contract, not a personal account.

Under a business contract the provider usually acts as your processor. On a personal account you are agreeing to its consumer terms instead.

Red · never in a consumer tool

Never paste these into a personal AI account

  • Payroll reports, salaries by name, bank details or National Insurance numbers
  • Named employee records: health, absence, grievance or disciplinary details
  • Customer or supplier ledgers with names attached
  • Unpublished results, forecasts or board papers
  • Anything a client has given you
  • Passwords, API keys or bank logins (in any tool, ever)
UK GDPR, in four lines
  1. Send the minimum. UK GDPR's data minimisation principle says personal data must be adequate, relevant and limited to what is necessary for the purpose. For most tasks on this site, the personal data the AI needs is none. 1ICO: The data minimisation principleico.org.uk
  2. Know who is controller and who is processor. Under a business contract, the AI provider usually acts as your processor. On a personal consumer account, you are agreeing to the provider's own consumer terms instead. 2ICO: Controllers and processorsico.org.uk
  3. Check where the data goes. Many AI services process data outside the UK. Restricted transfers need safeguards, which a business agreement usually addresses and a personal sign-up does not. 3ICO: International transfersico.org.uk
  4. The ICO has AI-specific guidance. It covers accountability, transparency, accuracy and security when organisations use AI with personal data. 4ICO: Guidance on AI and data protectionico.org.uk
Confidentiality
  • Your employment contract almost certainly includes a duty of confidentiality, and your organisation may have an AI policy. Read both before you start.
  • Client information belongs to the client. If you work in practice, confidentiality is one of the fundamental principles in professional codes such as ICAEW's. 5ICAEW Code of Ethics (confidentiality is a fundamental principle)www.icaew.com
  • Commercially sensitive information (pricing, margins, unpublished results, deal work) counts even when it contains no personal data.
Consumer plans vs business tiersChecked 1 October 2026
AI tool tiers and whether your data trains models
ProviderPersonal plansBusiness and enterprise
OpenAI (ChatGPT)Check settingsPersonal plans: conversations can be used to train models unless you turn off "Improve the model for everyone" in Settings > Data controls.Not trained on by defaultChatGPT Business, Enterprise, Edu and the API: not used to improve models by default.6OpenAI Help Centre: How your data is used to improve model performancehelp.openai.com7OpenAI: Enterprise privacy at OpenAIopenai.com
Anthropic (Claude)Check settingsFree, Pro and Max: chats are used to train models only when the model-improvement setting is on. With it on, data is kept for up to five years; with it off, the standard is 30 days.Not trained on by defaultClaude for Work and the API: inputs and outputs are not used to train models by default.8Anthropic: Updates to Consumer Terms and Privacy Policywww.anthropic.com9Anthropic Privacy Center: Is my data used for model training? (consumer)privacy.claude.com10Anthropic Privacy Center: Is my data used for model training? (commercial)privacy.claude.com
Microsoft (Copilot)Check settingsPersonal Microsoft accounts are covered by Microsoft's consumer terms, not your organisation's.Processor under DPACopilot and Copilot Chat used through an organisation: covered by Microsoft's Data Protection Addendum with Microsoft as processor; your data is not used to train foundation models.11Microsoft Learn: Enterprise data protection in Microsoft Copilot and Copilot Chatlearn.microsoft.com12Microsoft Learn: Data, privacy and security for Microsoft Copilotlearn.microsoft.com

From the same studio · disclosed

Where one of ours fits

ScriptGrain. If you write commentary every month, ScriptGrain drafts it in your own voice from a profile built from your past reports, so the pack still reads like you.

Ours: made by the same studio that runs this site.

Questions

Questions people ask. Every answer open.

Short answers, drawn from this page. The sources are listed above.

Something missing, or out of date? Tell the author.

Email hello@usingaias.com

P&L from a trial balance 5

Can I just paste my trial balance into ChatGPT or Claude and ask for a P&L?
You'll get a tidy table, but some totals may be wrong and you can't see how it got them. Let AI write the formulas and the words, and let Excel do the arithmetic. If a number didn't come out of a formula, it doesn't go in the pack.
What does the AI need to see to propose the mapping?
Only nominal codes and account names: no amounts, and no customer or staff names. Rename any account that contains a person's name first. You then read every row it proposes, because the mapping is where the judgement goes in.
Can Copilot in Excel build the P&L for me?
It can add the lookup column and write the SUMIFS formulas if it's in your Microsoft 365 subscription and your organisation allows it. Read every formula it writes, and if it types values instead of formulas, undo and ask for formulas.
What happens when a new nominal code appears?
If the mapping doesn't have it, its costs drop out of the P&L. Fill the lookup down to row 500 and check for UNMAPPED every month; the tie-back check will be out by exactly the missing amount.
Is Northfold Joinery a real company?
No. Northfold Joinery Ltd is fictional and its trial balance was generated for this guide. No real company's figures are used.
This page as markdown