Profit and Loss in Excel — Build a P&L Statement with Live Margins (2026)

A profit and loss statement tells the most important story in business: did you make money, and where did it go? In 40 minutes you’ll build a clean, formula-driven P&L in Excel — from revenue down to net profit — with gross, operating, and net margins, period-over-period variance, and red-flagged losses. Every subtotal is a formula, so the whole statement recalculates the moment you change a single figure.

Dr Waqas Rafique Dr Waqas Rafique · Founder & CTO · PhD, Statistical Machine Learning
· About

TL;DR

Stack the rows in order: Revenue → COGS → Gross Profit → Operating Expenses → Operating Profit → Interest & Tax → Net Profit. Total with SUM, derive each profit line by subtraction (=Revenue-COGS), and add margins by dividing each profit by revenue. Put periods in columns, add variance columns (=This-Last), and use conditional formatting to flag negatives in red.

Contents

  1. What is a Profit and Loss Statement?
  2. Before You Start
  3. Step 1 — Lay Out the Structure
  4. Step 2 — Revenue
  5. Step 3 — Gross Profit
  6. Step 4 — Operating Expenses
  7. Step 5 — Net Profit
  8. Step 6 — Margin Percentages
  9. Step 7 — Compare Periods
  10. Step 8 — Format & Visualise
  11. Try It: Live P&L Calculator
  12. A Worked Example
  13. Advanced Tips
  14. Common Errors & Fixes
  15. FAQ

What is a Profit and Loss Statement?

A profit and loss statement (also called an income statement or P&L) summarises a business’s revenues and expenses over a period — a month, quarter, or year — to show whether it made a profit or a loss. It is one of the three core financial statements, and it is the one owners and managers read most often because it answers the everyday question: are we making money?

The P&L works as a cascade. It starts with revenue at the top (the “top line”), subtracts the direct cost of goods sold to reveal gross profit, then subtracts operating expenses to reveal operating profit, and finally subtracts interest and tax to reach net profit (the “bottom line”). Each level strips away a different category of cost, so you can see exactly where profit is created and where it leaks away.

That layered structure is what makes the P&L so diagnostic. A strong gross profit but a weak net profit points to bloated overheads. A shrinking gross margin points to rising input costs or discounting. Because each line connects to the next by a simple formula, Excel is the natural home for a P&L: change one assumption and watch the consequence ripple all the way down to net profit instantly.

The discipline that separates a useful P&L from a fragile one is simple: never type a subtotal. Every total, every profit line, and every margin should be a formula referencing the cells above it. Do that and your statement is auditable, error-resistant, and reusable every period. This guide builds exactly that, then adds margins, period comparison, and formatting that makes the numbers legible at a glance.

Before You Start

Gather and categorise your figures first — the structure depends on getting the categories right.

Separate direct costs from overheads

Cost of goods sold (COGS) is the direct cost of producing what you sold — materials, manufacturing labour, payment processing, the wholesale cost of resold goods. Operating expenses are the overheads of running the business regardless of sales volume — rent, salaries, software, marketing. Getting this split right is what makes gross profit meaningful; lump them together and you lose the most useful line on the statement.

Pick your period and be consistent

Decide whether the statement covers a month, quarter, or year, and make sure every figure belongs to that same period. Mixing a year’s revenue with a month’s rent produces nonsense. If you want a monthly P&L, every input should be the monthly figure.

Cash vs accrual

Decide whether you are recording money when it moves (cash basis) or when it is earned/incurred (accrual basis). For a simple owner-managed P&L, cash basis is fine; for anything reported to lenders or investors, accrual is the standard. Either way, be consistent across periods so comparisons are valid.

💡 Pro tip: Keep your raw transaction data on one sheet and your P&L on another. Build the P&L with SUMIFS that pull each category from the transaction list, and the statement will rebuild itself every time you add a transaction — no retyping.
1
2
3
4
5
6
7
8

1.Step 1 — Lay Out the P&L Structure

In column A, type the statement skeleton top to bottom, leaving the value columns (B onward) empty for now:

Revenue
  (revenue lines...)
Total Revenue
Cost of Goods Sold
  (COGS lines...)
Total COGS
Gross Profit
Operating Expenses
  (expense lines...)
Total Operating Expenses
Operating Profit
Interest
Tax
Net Profit

This ordering is the universal P&L convention, and it matters: each subtotal sits directly below the lines it sums, and each profit line sits directly below the two numbers it subtracts. That physical layout is what lets you write clean, copyable formulas. Put your period label (e.g. “Jan 2026”) in B1.

2.Step 2 — Enter Revenue

List each revenue stream on its own row — product sales, service income, subscriptions — rather than a single lump. Then total them:

=SUM(B2:B4)

Keeping streams separate costs nothing and pays off immediately: you can see which line drives the top line, spot a stream that is shrinking, and later chart the revenue mix. Put this total in your “Total Revenue” row — it is the denominator for every margin you will calculate later, so it earns its own clearly labelled cell.

3.Step 3 — Calculate Gross Profit

List and total your COGS lines the same way with SUM. Then gross profit is one subtraction — total revenue minus total COGS:

=B5-B9

(Here B5 is Total Revenue and B9 is Total COGS — adjust to your row numbers.) Gross profit is the money left after the direct cost of what you sold, before any overheads. It answers the question: is the core product actually profitable to make and sell? If gross profit is thin or negative, no amount of cost-cutting elsewhere will save the business — the unit economics are broken.

4.Step 4 — Subtract Operating Expenses

List overheads — salaries, rent, marketing, software, utilities — each on its own row, and total them with SUM. Operating profit (also called EBIT, earnings before interest and tax) is gross profit minus total operating expenses:

=B10-B16

(B10 = Gross Profit, B16 = Total Operating Expenses.) Operating profit is the cleanest measure of how well the core business runs, because it ignores how the company is financed (interest) and the tax regime it sits in. It is the line investors scrutinise most when comparing companies.

5.Step 5 — Interest, Tax, and Net Profit

Subtract interest on any borrowing and your estimated tax to reach the bottom line:

=B17-B18-B19

(B17 = Operating Profit, B18 = Interest, B19 = Tax.) Net profit is the true bottom line — what the business actually kept. A company can post a healthy operating profit and still end up with a small or negative net profit if it carries heavy debt or sits in a high-tax bracket, which is exactly why the P&L separates these layers rather than jumping straight from revenue to net.

💡 Pro tip: Estimate tax as a formula on operating profit (e.g. =MAX(0,B17)*0.19) rather than a typed number, so it scales correctly when profit changes. Use MAX(0,...) so you do not accrue tax on a loss.

6.Step 6 — Add Margin Percentages

Absolute pounds tell you the size of profit; margins tell you the quality. In a column beside each profit line, divide it by total revenue and format as a percentage:

=B10/B5 (Gross Margin = Gross Profit / Revenue)

Do the same for operating margin (=B17/B5) and net margin (=B20/B5). Margins are powerful because they normalise for size: a business that grows revenue 50% but holds a 22% net margin is scaling efficiently; one whose margin drops to 12% as it grows is buying revenue at the expense of profitability. Track these three margins over time and you have an early-warning system for the health of the business.

MarginFormulaWhat it reveals
Gross marginGross Profit / RevenueProduct/unit economics
Operating marginOperating Profit / RevenueCore operating efficiency
Net marginNet Profit / RevenueOverall profitability after everything

7.Step 7 — Compare Periods and Add Variance

A single period is a snapshot; the value is in the trend. Put each month or year in its own column (B, C, D…) and copy your formulas across — because the references are relative, each column recalculates against its own inputs. Then add two variance columns comparing the latest period to the prior one:

=C20-B20 (absolute change in net profit)
=(C20-B20)/B20 (percentage change)

Wrap the percentage in IFERROR(...,"") to avoid a #DIV/0! when the prior period was zero. A year-over-year P&L with variance columns is the single most useful management report a small business can keep — it shows not just where you are, but the direction and speed of travel.

8.Step 8 — Format and Visualise

Formatting turns a grid of numbers into a readable statement. Apply the Accounting number format (Ctrl+1) so currency symbols and decimals align in neat columns. Bold the subtotal rows (Total Revenue, Gross Profit, Operating Profit, Net Profit) and give them a light fill so the eye lands on them. Indent the detail lines beneath each heading.

Flag losses automatically: select the value cells, Home → Conditional Formatting → Highlight Cells Rules → Less Than → 0, with a red font. Now any negative line — an operating loss, an unfavourable variance — stands out the instant someone opens the file.

Finally, a chart. A waterfall chart is purpose-built for a P&L: it shows revenue as the starting bar and each cost as a step down, ending at net profit, making the cascade visual. Insert → Waterfall, or see our waterfall chart tutorial for the full build.

Try It: Live P&L Calculator

Type your own figures and watch the statement compute every subtotal and margin instantly — exactly as the linked Excel formulas do. Notice how gross, operating, and net margins each respond differently as you change revenue, direct costs, and overheads: the gap between them is the diagnostic story of the business.

Profit & Loss Calculator

Enter figures for the period — profit lines and margins recalculate live.

£
£
£
£
%

Advanced P&L Tips

Build it from transactions with SUMIFS

Instead of typing category totals, pull them from a transaction sheet: =SUMIFS(Txns[Amount],Txns[Category],"Marketing",Txns[Month],B$1). Each P&L line becomes self-updating, and a new column per month gives you a rolling twelve-month statement with zero retyping.

Common-size the statement

Express every line as a percentage of revenue, not just the profit lines. A “common-size” P&L makes it obvious when, say, marketing creeps from 8% to 14% of revenue — a shift that is invisible in raw pounds as the business grows.

Add a 12-month rolling total

A rolling 12-month net profit (=SUM(last 12 monthly cells)) smooths out seasonality and is often a truer signal of the trajectory than any single month or the calendar-year-to-date figure.

Automate it end to end

When monthly P&L prep becomes a chore, DataHub Pro builds the statement and margin trends straight from your uploaded transactions or accounting export — live, shareable, and refreshed automatically.

A Worked Example

Walk a simple month through the cascade. Revenue is £100,000. Cost of goods sold — the direct cost of delivering what you sold — is £40,000, so gross profit is £60,000 and the gross margin is 60% (60,000 / 100,000). That 60% is the headline efficiency of the product itself: six out of every ten pounds of sales survive the direct cost of production.

Operating expenses — salaries, rent, marketing, software — total £32,000. Subtract them and operating profit is £28,000, a 28% operating margin. This is the cleanest read on the core business: after running costs but before financing and tax, the company keeps 28p per pound of sales. Then interest of £2,000 and tax at 19% of the £26,000 pre-tax profit (about £4,940) come off, leaving a net profit of roughly £21,060 — a 21% net margin.

The three margins — 60%, 28%, 21% — tell the whole story in one glance. A wide gap between gross and operating margin (60% to 28%) says overheads consume a large slice of gross profit; if that gap widened next month, you would investigate which overhead grew. The small step from operating to net margin (28% to 21%) shows financing and tax are modest. Track these three numbers every month and you have a continuous read on the health of the business that no single profit figure can give. The interactive calculator above is loaded with this exact scenario — change any input and watch all three margins move.

Common Errors & Fixes

Subtotals don’t match the lines above

Your SUM range is too short or too long — it is missing a row or accidentally including a subtotal (double-counting). Click the total cell and check the highlighted range covers exactly the detail lines, nothing more.

Margins show as huge numbers, not percentages

The cell is formatted as a number. Select it and apply Percentage format (Ctrl+Shift+%), or the 0.22 will display as 0 or 22000% depending on format.

#DIV/0! in a margin or variance

Revenue or the prior period is zero. Wrap the formula in IFERROR(...,"") or IF(B5=0,"",...) so blank periods display cleanly.

Net profit looks wrong after adding a row

Inserting a row inside a SUM range usually extends it automatically, but inserting at the very edge may not. After structural edits, click each subtotal and confirm its range still covers the right cells.

From Spreadsheet to Live Financial Dashboard

DataHub Pro turns your P&L data into an always-current dashboard with margin trends and period comparisons in under 60 seconds. Upload your file and share a link instead of emailing another spreadsheet.

Try DataHub Pro free →

Frequently Asked Questions

How do I create a profit and loss statement in Excel?
Lay out labelled rows in the standard order: Revenue, Cost of Goods Sold, Gross Profit, Operating Expenses, Operating Profit, Interest and Tax, and Net Profit. Enter your figures, total revenue and COGS with SUM, then subtract to derive each profit line — Gross Profit = Revenue minus COGS, Operating Profit = Gross Profit minus operating expenses, Net Profit = Operating Profit minus interest and tax. Add margin percentages by dividing each profit line by revenue, and put each period in its own column so you can compare months or years.
What is the formula for gross profit in Excel?
Gross profit is total revenue minus total cost of goods sold. If total revenue is in cell B5 and total COGS in B9, the formula is =B5-B9. Gross margin as a percentage is gross profit divided by revenue: =(B5-B9)/B5, formatted as a percentage. Gross profit shows how much money is left after the direct cost of producing what you sold, before any overheads.
What is the difference between gross, operating, and net profit?
Gross profit is revenue minus the direct cost of goods sold — it measures production efficiency. Operating profit (EBIT) subtracts operating expenses such as salaries, rent, and marketing from gross profit — it measures how well the core business runs. Net profit is the true bottom line: operating profit minus interest and tax. A business can have a healthy gross profit but a negative net profit if overheads, interest, or tax are too high, which is why all three lines matter.
How do I calculate net profit margin in Excel?
Net profit margin is net profit divided by total revenue, expressed as a percentage: =NetProfit/Revenue, then format the cell as a percentage. For example, £20,000 net profit on £100,000 revenue is a 20% net margin. Margins let you compare profitability across periods or against competitors regardless of absolute size, because they normalise everything to a share of revenue.
Should I use a P&L template or build one from scratch?
Building from scratch teaches you exactly how each line connects and lets you tailor the structure to your business, which is valuable the first time. Once you understand it, a reusable template saves time each period — set up the formulas once, then only update the input figures. The key in either case is to use formulas for every subtotal and margin rather than typing numbers, so the whole statement recalculates correctly when any input changes.
How do I show negative numbers in red on an Excel P&L?
Select the figures, press Ctrl+1 to open Format Cells, choose Number or Accounting, and pick a format that shows negatives in red — or create a custom format like #,##0;[Red](#,##0). For more control, use Conditional Formatting → Highlight Cells Rules → Less Than → 0 with a red font. This makes losses and unfavourable lines jump out instantly when someone scans the statement.
How do I compare actual results to budget on a P&L?
Put budget and actual in adjacent columns for each line, then add a variance column with =Actual-Budget and a variance-percentage column with =(Actual-Budget)/Budget. For revenue and profit lines a positive variance is favourable; for cost lines a negative variance (spending less than budget) is favourable. See our dedicated budget vs actual tutorial for a full variance model with conditional formatting.
Can Excel produce a monthly P&L automatically from transaction data?
Yes. Keep a transaction list with date, category, and amount, then build the P&L with SUMIFS that pull each category's total for a chosen month, or use a PivotTable with categories as rows and months as columns. A SUMIFS-driven P&L updates itself the moment you add new transactions, turning a manual monthly chore into a live statement. DataHub Pro can automate this end to end from an uploaded file.

Related Tutorials