Year-over-year (YoY) comparison in Excel shows how a value changed between the same period in two different years, which strips out seasonal swings and reveals the real trend. The quickest way is to put last year's figures and this year's figures in two adjacent columns, then use a formula such as = (B2-A2) / A2 and format the result as a percentage. That gives you a growth rate you can scan down a column of months or years.
There is nothing complicated to install, but a little setup beforehand saves time. Keep one row per period, one column per year, and store numbers as true values rather than text typed with spaces or currency symbols embedded awkwardly. The steps below assume a standard worksheet layout; menu labels in Excel can differ slightly by version, platform and region, so if a button name looks different, look for the closest equivalent.
What You'll Need
- A spreadsheet with two columns of comparable figures, one for the earlier year and one for the later year, aligned to the same rows (month, quarter or year).
- A column to hold the result, plus an empty cell if you want to build the formula once and copy it.
- A clear understanding of which figure is the denominator. In a YoY calculation, the earlier year is the base, so it must not be zero.
- Clean data: no blank rows inside the range, and no text mixed into the number columns, because either will break the formula or produce errors.
Step-by-Step
- Lay out the data. Put the period label in one column, the earlier year's values in the next, and the later year's values in the one after. For example, A2 might hold "January", B2 holds 2025's sales, and C2 holds 2026's sales. Repeat down the rows so each period sits on its own line.
- Confirm the figures are numbers. Select the number columns and check that they align to the right by default; text sneaks in and aligns left. If figures are left-aligned, convert them with Data > Text to Columns, or by multiplying them by 1, so Excel treats them as values.
- Write the growth formula in the first result cell. With this year in C2 and last year in B2, type
= (C2 - B2) / B2and press Enter. The difference between the two years is divided by the earlier year, which gives the proportional change. - Format the result as a percentage. Select the formula cell, then use the Home tab's percentage style button or Ctrl+Shift+% on Windows, or the equivalent percentage format on the Home tab on Mac. Set the decimals to one or two places with the Increase Decimal button so the figures stay readable.
- Copy the formula down. Grab the small square at the bottom-right of the formula cell and drag it to the last row, or double-click it to fill automatically. Relative references mean each row will compare its own pair of years.
- Handle a zero or blank base. If any earlier-year figure is zero or empty, the formula returns a division error. Wrap it with an error handler such as
= IFERROR((C2-B2)/B2,"")so the cell stays blank instead of showing a hash error. - Add context with a labelled header. Name the result column something like "YoY change" and, if helpful, add a second column for the absolute difference using
= C2 - B2. The percentage shows momentum; the absolute figure shows the size of the change. - Check a couple of results by hand. Take one row where last year was 200 and this year is 250: the result should be 25%. Verifying two or three rows catches a mis-aligned range or a swapped denominator before it spreads.
- Make it readable. Apply conditional formatting to the growth column so negative values appear red and positive ones green. Use Home > Conditional Formatting > Highlight Cells Rules or a colour scale, then freeze the header row with View > Freeze Panes so labels stay visible while you scroll.
Common Mistakes
- Dividing by the newer year instead of the older one. YoY growth is measured against the prior year, so the denominator must be the earlier figure. Reversing it produces a mathematically valid but misleading number.
- Leaving cells in text format. Numbers imported from another system often arrive as text, and the subtraction silently fails or returns zero. Formatting the column as a number and re-entering or converting the values fixes it.
- Comparing unequal periods. A full year against an eleven-month span, or a full month against a partial one, inflates or deflates the change. Align the date ranges exactly.
- Ignoring zero or blank base values. A new product line with no prior-year sales has no meaningful percentage change. Show it as "new" or leave it blank rather than displaying a huge or erroneous figure.
- Forgetting absolute references for fixed bases. If you divide every row by one fixed total, anchor it with dollar signs (for example
$B$2) so it does not shift as you copy down. - Hiding bad data with formatting. A red or green colour does not correct a wrong calculation. Check the underlying formula before trusting the colour.
Tips
- Put the periods in a real date column and build the year columns with formulas where possible, so next year's data slots in without restructuring.
- Add a total row that sums both years and calculates overall growth, giving a headline figure alongside the month-by-month detail.
- Use a simple line chart on the percentage column to show the trend at a glance; a bar chart suits absolute differences better.
- Keep raw data on one sheet and calculations on another so the working file stays clean and auditable.
- If you compare many years, consider a compact table or pivot table where rows are periods and columns are years, which makes multi-year trends far easier to scan.
Troubleshooting
If the formula shows #DIV/0!, the earlier-year cell is zero or empty. Check whether that is genuine (a new line, a closed month) and either exclude it or wrap the formula in IFERROR. If you see #VALUE!, one of the cells contains text or a stray character such as a non-breaking space; clean the data and retry.
If copying the formula gives the same result in every row, the references are absolute when they should be relative, or vice versa. Click a cell and inspect the formula bar: dollar signs lock a reference. If the percentage looks correct but displays as a decimal, apply the percentage number format to the cell rather than retyping.
If the numbers are wildly off, confirm the two columns really belong to adjacent years and that no rows shifted during a sort or paste. Sorting one column without the others is the usual culprit; undo and re-sort the whole range together. If a cell shows a green triangle warning, Excel suspects a formula inconsistency; click it and read the hint before accepting or ignoring it.
Frequently Asked Questions
What is the formula for year-over-year growth in Excel?
Use = (CurrentYearValue - PreviousYearValue) / PreviousYearValue, then format the result as a percentage. Replace the two cell positions with your own, for example = (C2-B2)/B2.
How do I calculate year-over-year change for a month, not a whole year?
Use the same formula with the figures for that month in both years. As long as the periods match (January this year against January last year), the calculation is a valid YoY comparison.
Why does my YoY formula return #DIV/0!?
The previous-year figure is zero or the cell is empty. Wrap the formula in IFERROR to show a blank, or mark the row as having no prior-year comparison.
Can I compare more than two years at once?
Yes. Add a column per year and calculate each year against the one before it, or compare every year to a chosen baseline year using an absolute reference. A pivot table with years as columns makes multi-year comparison easier.
Does it matter which year I divide by?
Yes. The earlier year is the base, so it must be the denominator. Dividing by the current year gives a different, less conventional number and can mislead readers.
How do I show the change as a plus or minus sign?
Apply a custom number format with a plus sign for positive values and a minus for negative ones through Format Cells > Number > Custom, or simply rely on conditional formatting to colour gains and losses.