How to Calculate CPM in Excel and Google Sheets

Quick answer

In Excel or Google Sheets: =(B2/C2)*1000 with cost in B2 and impressions in C2. Roll a whole flight up with =(SUM(B2:B100)/SUM(C2:C100))*1000, and wrap either in IFERROR so blank rows stop showing #DIV/0!.

Build a reliable CPM calculator Excel workbook: learn how to calculate CPM in Excel, reverse formulas for budget and volume, copy-paste templates, and fixes for the mistakes that break spreadsheet CPM reports. For the full theory, see our CPM formula guide — then return here for spreadsheet-specific workflows.

Basic Excel CPM Formula

When people search for how to calculate CPM in Excel, they usually need one clean cell formula that turns spend and impressions into a CPM rate. The math matches the standard definition on our CPM formula page:

CPM from cost and impressions
CPM = (Total Cost ÷ Impressions) × 1,000

In Excel, multiply by 1,000 with *1000 — not with a separate column unless you intentionally structure it that way.

Assume Row 1 is headers and Row 2 is your first campaign:

  • B2 = Total Cost (currency)
  • C2 = Impressions (whole number)
  • D2 = CPM (currency per thousand impressions)
Excel / Google Sheets — calculate CPM in Excel (cell D2)
=(B2/C2)*1000

This is the core CPM calculator Excel pattern: divide cost by impressions, then scale to per-thousand pricing.

Quick check: if B2 is $1,500 and C2 is 600,000, D2 returns 2.5 — format D2 as currency to read $2.50 CPM. You can verify the same numbers with our online CPM calculator.

Reverse Formulas for Cost and Impressions

A good calculate CPM in Excel workbook solves all three variables — not only CPM. Use the same layout (B2 = cost, C2 = impressions, D2 = CPM) and pick the formula for the value you are missing.

Total cost from CPM and impressions

Excel — cost in B2 when CPM is in D2 and impressions in C2
=(D2*C2)/1000

Equivalent to: Total Cost = (CPM × Impressions) ÷ 1,000. For a dedicated walkthrough, see calculate cost from CPM.

Impressions from budget and CPM

Excel — impressions in C2 when cost is in B2 and CPM is in D2
=(B2/D2)*1000

Equivalent to: Impressions = (Total Cost ÷ CPM) × 1,000. More context and examples: calculate impressions from CPM.

Tip: Do not average CPMs row-by-row to get a portfolio CPM unless every row has equal weight. For blended CPM across campaigns, use total cost and total impressions: =(SUM(B2:B100)/SUM(C2:C100))*1000.

Example Spreadsheet Setup

Below is a minimal CPM calculator Excel template you can copy. Keep one consistent row per campaign; extend formulas down from row 2.

A B C D
Row 1 Campaign Total Cost ($) Impressions CPM ($)
Row 2 Spring Display 1500 600000 =(B2/C2)*1000
Row 3 Remarketing 800 200000 =(B3/C3)*1000

Format B and D as Currency, C as Number with zero decimals and thousands separators. Name the sheet CPM_Model or similar so exports stay readable for stakeholders.

IFERROR and Formatting Tips

Production sheets should fail gracefully when impressions are missing or zero — otherwise how to calculate CPM in Excel becomes a wall of #DIV/0! errors.

IFERROR wrapper

Safer CPM cell (example: D2)
=IFERROR((B2/C2)*1000, "")

Returns blank instead of an error when C2 is 0 or empty. Use a visible placeholder like "—" if you prefer.

ROUND for reporting

For client-facing tables, round to two decimals: =IFERROR(ROUND((B2/C2)*1000, 2), ""). Keep unrounded values in a hidden column if you need audit trails.

Formatting checklist

  • Currency for cost and CPM columns
  • Number with comma separators for impressions
  • Freeze header row (View → Freeze Panes) for long campaign lists
  • Data validation on impressions (e.g., whole numbers ≥ 0)

Google Sheets Version

Calculate CPM in Excel and calculate CPM in Google Sheets use the same formulas: =(B2/C2)*1000, =(D2*C2)/1000, and =(B2/D2)*1000. Named ranges, IFERROR, and ROUND behave the same way for typical media plans.

Sheets-specific notes:

  • Sharing: set view or comment access for stakeholders; protect formula columns if needed.
  • Locale: if your sheet uses comma decimal separators, adjust formula syntax (semicolons) per your locale — the underlying CPM math is unchanged.
  • Collaboration: version history helps when someone overwrites CPM cells with hard-coded values — restore formulas from history if that happens.

When the Cell Is Not the Number: Storage, Text, and Format Boundaries

Most “the CPM model is wrong” reports are not formula errors. They are the three places where a spreadsheet stops behaving like arithmetic: what is actually stored behind a displayed value, whether an imported number is a number at all, and what a format change does (and does not) do.

1. The displayed value is not the stored value

Excel stores numbers as IEEE 754 floating-point values and keeps only 15 significant digits, as documented in Microsoft’s own troubleshooting article on floating-point arithmetic. Microsoft’s own example: A1: 0.000123456789012345, B1: 1, C1: =A1+B1 returns 1.00012345678901, not the full digits you typed.

The consequence for a CPM model is that two cells can print the same figure and still fail an equality test. Microsoft lists exactly two compensations: the ROUND function (their example: =ROUND(A1, 2) on 23.7825 gives 23.78), and the Set precision as displayed option under File › Options › Advanced › When calculating this workbook. The second one is not a tidy fix: Microsoft warns that it “can have cumulative calculation effects that can make your data increasingly inaccurate over time” and advises using it only when you are certain the displayed precision preserves accuracy. For a sheet that re-prices a media plan every week, rounding at the cell level with ROUND and keeping raw impressions in a hidden column is the safer default.

2. Imported impressions that are not numbers

A CSV column of impressions can arrive as text. Microsoft describes the symptom plainly: numbers stored as text cause “unexpected results, like an uncalculated formula showing instead of a result”, and the cell carries an error indicator in its top-left corner (see Convert numbers stored as text to numbers). Select the cell, open the error indicator, and choose Convert to Number; alternatives are the VALUE function, or pasting the column back over itself with Paste Special › Values.

Microsoft’s second route is arithmetic rather than menu-driven: in fixing text-formatted numbers they multiply each cell by 1 to force the conversion, which leaves the value looking identical while making it a real number. Why this matters specifically for CPM: =(B2/C2)*1000 against a text C2 does not return a plausible-looking-but-wrong CPM—it returns an error or a blank, which is the friendliest failure mode. The silent one is SUM() over a column where three impressions cells are text: the total quietly drops those rows, and the blended CPM then divides a cost total by an impression subtotal.

3. Format changes are display-only—until you cross into Sheets

In Google Sheets, the characters in a custom number format change what you see, not what is stored: an 0 makes an insignificant zero appear, # makes it not appear, and ? shows it as a space (format numbers in a spreadsheet). The same page adds the rule that quietly breaks shared sheets: the period in a format is the decimal separator, and “the spreadsheet locale determines which character is used as the decimal separator for all numeric values”—so a plan built in a locale that prints commas reads differently the moment someone else opens it.

Sheets also evaluates one formula across a whole range: ARRAYFORMULA applies a formula to multiple rows or columns, with Google’s own sample usage ARRAYFORMULA(SUM(IF(A1:A10>5, A1:A10, 0))), and array results spill to the right and below the entry cell (see using arrays in Google Sheets). That is convenient for a per-row CPM column, and it is also how one edited cell can overwrite a neighbouring formula without anyone touching it.

Common Spreadsheet Mistakes

Even strong analysts slip on these when building a CPM calculator Excel file:

1. Forgetting ×1,000

Dividing only B2/C2 yields cost per impression. Your CPM will look hundreds or thousands of times too small. Always multiply by 1,000 for standard CPM.

2. Mixed units (thousands of impressions)

If a column stores impressions in thousands (e.g., 600 meaning 600,000), you must either convert back to raw impressions or change the formula. Mixing units across rows destroys blended CPM.

3. Averaging CPMs instead of weighting

=AVERAGE(D2:D20) is wrong when row spend differs. Weight by cost and impressions with =(SUM(B2:B20)/SUM(C2:C20))*1000.

4. Hard-coding CPM after one export

Pasting values from a platform report is fine for snapshots — but label them as static. Live models should reference cost and impressions so calculate CPM in Excel stays reproducible.

5. Using reach instead of impressions

Reach counts unique users; impressions count all ad views. CPM formulas require impressions, as explained on our CPM formula page.

Use these when you want browser-side checks or deeper reading alongside your spreadsheet:

FAQ

Use CPM = (Total Cost ÷ Impressions) × 1,000. With cost in B2 and impressions in C2, enter =(B2/C2)*1000. That is the standard answer for how to calculate CPM in Excel and matches the definition on our CPM formula page.

Create columns for campaign name, total cost, impressions, and CPM. Put =(B2/C2)*1000 in the CPM column and fill down. Add IFERROR for blank or zero impressions, format currency and number columns, and use SUM for totals plus a blended CPM row with =(SUM(B:B)/SUM(C:C))*1000 (adjust ranges).

Yes for standard arithmetic. The same CPM calculator Excel formulas work in Google Sheets: =(B2/C2)*1000 for CPM, =(D2*C2)/1000 for cost, and =(B2/D2)*1000 for impressions. Only locale-specific separators may differ.

Use our focused guides: calculate impressions from CPM and calculate cost from CPM. Both pair well with a spreadsheet model and with the CPM calculator for quick checks.

You likely omitted the *1000 multiplier or divided the wrong fields. Cost per single impression is much smaller than CPM. Re-read the CPM formula section and confirm impressions are full counts, not thousands.