A YoY (year-over-year) formula in Excel compares a value from this year with the same period last year to show growth as a percentage. There is no built-in YoY function; you build it yourself with a simple division: (this year − last year) ÷ last year. Assuming this year's value is in cell B2 and last year's is in A2, the formula is =(B2-A2)/A2, formatted as a percentage. This guide walks through setting it up properly, handling last year's zeros, and fixing common errors.

What You'll Need

  • Excel on Windows, Mac, or Excel for the web (any recent version works; the formulas here are standard in all of them)
  • A worksheet with data in two columns or two rows: one period's values and the same period's values from a year earlier

Step-by-Step

  1. Organize your data. Put last year's values in one column and this year's in the next, with matching rows. For example: A2 = sales for March last year, B2 = sales for March this year. Make sure the cells contain numbers, not text that looks like numbers (numbers align right by default; text aligns left).
  2. Click the cell where you want the YoY result — typically C2, next to your first pair of values.
  3. Enter the basic formula: =(B2-A2)/A2 and press Enter. Cell references must point to this year first, then last year; reversing them flips the sign of your result.
  4. Format the result as a percentage. Select the cell, then on the Home tab click the % button in the Number group (or press Ctrl+Shift+% on Windows). You can also use the Increase Decimal / Decrease Decimal buttons next to it to control how many decimal places show.
  5. Copy the formula down. Select the cell with the formula, hover over the small square at its bottom-right corner (the fill handle), and double-click or drag down alongside your data. The relative references adjust automatically for each row.
  6. Handle zeros and blanks. If last year's value is zero or blank, the formula returns #DIV/0!. Wrap it in IFERROR to show a dash instead: =IFERROR((B2-A2)/A2,"-"). To leave blank rows blank, use =IF(OR(A2="",B2=""),"",(B2-A2)/A2).
  7. Optional — build a single array formula. If your values are in B2:B13 (this year) and A2:A13 (last year), in a modern version of Excel with dynamic arrays you can enter =(B2:B13-A2:A13)/A2:A13 in one cell and it spills the results down automatically.
  8. Optional — YoY from a single column of dates and values. If column A holds dates and column B holds monthly values sorted by date, you can compare each month to the one 12 rows earlier: =(B14-B2)/B2 in row 14, then fill down. This only works reliably when you have exactly one row per period with no gaps.

Common Mistakes

  • Reversing the references. =(A2-B2)/A2 gives the change in the wrong direction. This year's value always goes first.
  • Comparing the wrong periods. YoY means the same month or quarter a year apart, not the previous month. Comparing December to November is month-over-month, not YoY.
  • Forgetting to format as a percentage. A raw result of 0.12 is correct but easy to misread as 12 or 0.12% — format it so it displays as 12%.
  • Mixing text and numbers. Cells containing "1,200" as text or values with currency symbols typed in will break the math. Check alignment, or use Excel's warning icon that appears when numbers are stored as text.
  • Dividing by a negative prior-year value. When last year was negative (e.g., a loss), the sign of the result can be misleading. Interpret those rows carefully or note them separately.
  • Inserting rows inside the range after building the formula. Rows added at the end of a table may not be picked up — convert your data to an Excel table (Ctrl+T) so formulas extend automatically.

Tips

  • Use a table. Select your data and press Ctrl+T. New rows added to the table automatically copy your YoY formula down.
  • Conditional formatting highlights growth. Select your YoY column, go to Home > Conditional Formatting > Color Scales to spot strong and weak performers at a glance.
  • Use absolute references for a fixed base. To compare every month against one fixed figure in $A$2, use =(B3-$A$2)/$A$2 — the dollar signs lock the reference when you fill down.
  • ROUND for cleaner reports: =ROUND((B2-A2)/A2,3) rounds the underlying value to three decimal places (0.1% precision) before formatting.
  • Label columns clearly — e.g., "2024", "2025", "YoY %" — so anyone reading the sheet knows which direction the change runs.

Troubleshooting

  • #DIV/0! error: last year's cell is zero or empty. Use the IFERROR wrapper from step 6, or check that the cell reference points where you think it does.
  • #VALUE! error: one of the referenced cells contains text instead of a number. Click the cell and look for Excel's green warning triangle, or re-enter the value as a plain number.
  • Formula shows instead of the result: the cell was formatted as Text before you typed the formula. Change the format to General (Home tab, Number group), then click the cell and press F2 and Enter to re-evaluate.
  • Result looks wrong: click the cell and check the colored reference outlines Excel draws around the cells the formula points to. If a reference is off by a row, fix it directly in the formula bar.
  • Results don't update after data changes: calculation may be set to manual. Go to Formulas > Calculation Options and select Automatic, then press F9 to recalculate.

Frequently Asked Questions

Is there a built-in YoY function in Excel?

No. Excel has no dedicated year-over-year function. You build it with basic arithmetic, most commonly =(B2-A2)/A2, optionally wrapped in IFERROR.

How do I calculate YoY in a pivot table?

Add your value field twice, then right-click the second one and choose Show Values As > % Difference From, and set the Base Field to your year or date field with Base Item set to (previous). This works when your data includes a year or date field.

Can Power Query or Power Pivot calculate YoY?

Yes. In Power Pivot you can write a DAX measure such as a year-over-year comparison using SAMEPERIODLASTYEAR, or in Power Query add an index and merge the table with itself offset by twelve rows. For most everyday needs, the plain worksheet formula is simpler.

Does the formula work for decreases too?

Yes. If this year is lower than last year, the result is simply negative, e.g., −8%. Nothing in the formula needs to change.

What's the difference between YoY and YTD growth?

YoY compares one period (a month or quarter) with the same period a year ago. Year-to-date growth compares the cumulative total from January through the current month with the same cumulative span a year earlier — just sum the ranges first, then apply the same division.

Will the formula work in Google Sheets too?

Yes. Google Sheets uses the same formula syntax, so =(B2-A2)/A2 and the IFERROR wrapper work identically there.