ROAS Formula in Excel and Google Sheets From an Ad Export

Build a ROAS sheet from an ad export: per-row ROAS with a zero-spend guard, SUM/SUM totals, SUMIFS by campaign, break-even ROAS and spend stored as text.

本文目錄

You’ve downloaded a campaign report with spend and conversion value, and you want ROAS for each row, for each campaign and for the whole account. The per-row part is easy. The account total is where most sheets go wrong, because the obvious move, averaging the ROAS column, gives the wrong answer.

On the sample export below, the total ROAS is this:

=SUM(E2:E10)/SUM(C2:C10) → 2.40

Averaging the per-row ROAS with =AVERAGE(F2:F10) returns 4.17 for the same nine rows. Same data, a number about 1.7 times as flattering. The rest of this page builds the sheet around the correct total, adds a SUMIFS table per campaign, checks the result against a break-even ROAS, and fixes the export problem that breaks all of it: spend stored as text with a dollar sign.

A three-day sample export

This is made-up data for a fictional online candle shop, not a real ad account. Type it into A1:E10, with the dates as real dates.

ABCDE
1DateCampaignSpendConversionsConv. value
22026-10-05Brand Search1209810
32026-10-05Generic Search64011990
42026-10-05Retargeting854380
52026-10-06Brand Search1108700
62026-10-06Generic Search72010860
72026-10-06Retargeting000
82026-10-07Brand Search13010920
92026-10-07Generic Search690121140
102026-10-07Retargeting955410

Conversion value is the revenue the ad platform credits to the ads. Row 7 is the retargeting campaign on a day it was paused, which is why it’s all zeros. A download that includes paused campaigns has rows like that, and they’re the first thing to trip a ROAS formula.

ROAS on each row, with paused rows left blank

In F1 type ROAS, then in F2:

=IF(C2=0,"",E2/C2)

Fill it down to F10. F2 returns 6.75 (810 ÷ 120), F3 returns 1.546875, and F7 stays empty. Without the IF, =E7/C7 is #DIV/0!. A genuinely blank spend cell passes the same test, because a blank compares equal to 0, so stray empty rows also come out blank instead of as errors.

I’d leave the cell empty rather than write =IFERROR(E2/C2,0). A 0 looks like a campaign that spent money and sold nothing, and it gets counted by AVERAGE, MIN and every chart you build on the column. IFERROR also hides errors you’d want to see; the #DIV/0! page goes through that trade-off.

Why the account total is SUM over SUM

Add a total row. In A12 type Total, then fill C12:F12:

C12  =SUM(C2:C10)               → 2590
D12  =SUM(D2:D10)               → 69
E12  =SUM(E2:E10)               → 6210
F12  =SUM(E2:E10)/SUM(C2:C10)   → 2.3977
Google Sheets with F12 selected, showing =SUM(E2:E10)/SUM(C2:C10) in the formula bar and 2.397683398 in the Total row, under the nine-row candle-shop export. Spend totals 2590 and conversion value 6210; the per-row ROAS column shows 6.75 and 1.546875 at the top and leaves the paused row 7 blank.
Screenshot: Google Sheets, Nov 2026

Rounded to two decimals, F12 is the 2.40 from the top of the page. That’s the ROAS of the whole three days: $6,210 back on $2,590 spent.

=AVERAGE(F2:F10) returns 4.1713 because it gives every row the same weight. Brand Search’s $120 day at 6.75 counts as much as Generic Search’s $720 day at 1.19, and the cheap, high-ROAS rows pull the result up. Averaging the three campaign ROAS figures in the next section is no better: it returns 4.1991. If column F used the IFERROR-to-0 version, the paused row joins the average and it drops to 3.7078, which is wrong in a different direction. Dividing the two sums weights every row by what it spent, which is what a total should do.

ROAS per campaign with SUMIFS

Put the campaign names in H2:H4 (Brand Search, Generic Search, Retargeting) and headers Spend, Conv. value, ROAS in I1:K1. Then:

  • I2: =SUMIFS($C$2:$C$10,$B$2:$B$10,H2)
  • J2: =SUMIFS($E$2:$E$10,$B$2:$B$10,H2)
  • K2: =IF(I2=0,"",J2/I2)

Fill I2:K2 down to row 4.

CampaignSpendConv. valueROAS
Brand Search36024306.75
Generic Search205029901.4585
Retargeting1807904.3889
Google Sheets with I2 selected, showing =SUMIFS($C$2:$C$10,$B$2:$B$10,H2) in the formula bar and 360. The campaign table beside the export lists Brand Search 360, 2430, 6.75; Generic Search 2050, 2990, 1.458536585; Retargeting 180, 790, 4.388888889. Below it, I7 holds the 40% margin and I8 the break-even ROAS 2.5.
Screenshot: Google Sheets, Nov 2026

The spend column adds back to 2,590 and the value column to 6,210, which is a quick way to confirm no row was missed. A campaign name with a trailing space or a slightly different spelling won’t match, and SUMIFS returns 0 without an error; SUMIF returns 0 covers those causes. Typing a name with no rows, such as Display, gives 0 spend, and the IF in column K leaves its ROAS blank.

Keep spend next to ROAS in this table. A 6.75 on $360 and a 1.46 on $2,050 aren’t comparable on ROAS alone, and Generic Search is where most of the money went.

Is 2.40 good enough? Break-even ROAS from your margin

ROAS doesn’t know what your products cost. Suppose the shop keeps 40% of each sale after product cost and shipping (again a made-up figure). Put that in I7 as 40%, and in I8:

=1/I7 → 2.5

That’s the ROAS at which ad spend uses up exactly the margin. The account’s 2.40 is under it. =E12*I7-C12 returns -106: across the three days, the margin on attributed sales fell $106 short of the ad spend. For Generic Search alone, =J3*I7-I3 returns -854, while Brand Search and Retargeting are comfortably above 2.5. That’s the line I’d look at first in this account.

This treats conversion value as the sale price and ignores costs other than product and shipping, so use it as a threshold, not a profit report.

2.40, 240% and ROI

The same ROAS is often written as a percentage. Format F12 as a percentage with two decimals (0.00%) and 2.3977 shows as 239.77%. Don’t also multiply by 100: =F12*100 in the same format shows 23976.83%.

That 240% is not ROI. ROI on this site is profit over cost:

=(E12-C12)/C12 → 1.3977, or 139.77%

A report that shows “240%” in one column and “140%” in another for the same spend needs labels that say which is which. The ROAS calculator 與 ROI calculator use the same two definitions if you want to check a single pair of numbers. From the same total row, =C12/D12 gives a cost per conversion of 37.54; the CPA calculator does that one. ROAS uses the value the ad platform claims for its own ads. If you need spend per new customer across every channel, that’s blended CAC.

When spend arrives as “$640.00” text

Depending on how the report was exported or pasted, the spend column can arrive as text with the currency symbol attached. The sheet doesn’t look broken at first. In Google Sheets with a US locale and in LibreOffice Calc, the row formula in F2 still returned 6.75, because the division converted $120.00 on the fly (I didn’t run this part in Excel). Everything that sums the column fails:

  • F12 returns #DIV/0!, because SUM skips text and SUM(C2:C10) is 0.
  • The SUMIFS spend for Brand Search is 0.
  • F7 returns #DIV/0! even with the IF guard, since the text $0.00 is not equal to 0.

Confirm it by comparing =COUNT(C2:C10) with =COUNTA(C2:C10). On the text version they returned 0 and 9: nine filled cells, none of them numbers.

The fix I’d use is a helper column. In G1 type Spend (number), then in G2:

=VALUE(SUBSTITUTE(SUBSTITUTE(C2,"$",""),",",""))

Fill it down. G2 returns 120, G7 returns 0, and $1,240.50 becomes 1240.5. Point the ROAS formula, the total and the SUMIFS at column G instead of C, and the total goes back to 2.3977 and Brand Search’s spend to 360.

Why not plain =VALUE(C2)? In the US-locale sheet it returned 120. In a sheet set to the Chinese (China) locale, the same cell gave #VALUE!, with Sheets reporting that $120.00 could not be parsed to a number. Removing the symbol first worked in both. The helper does assume a dot for decimals and commas for thousands; on 1.240,50 it returned 1.2405 instead of 1240.5. For other ways to convert a whole column in place, see convert numbers stored as text.

Oscar

寫 Excel 與 Google Sheets 的公式和排錯。

Google Sheets (US English locale) and LibreOffice Calc 25.2, 18 November 2026, on the fictional export below. Row ROAS 6.75 / 1.546875 / blank for the paused row; total SUM/SUM 2.3977; AVERAGE of row ROAS 4.1713; average of campaign ROAS 4.1991; IFERROR-to-0 column averaged 3.7078 (Sheets). SUMIFS by campaign 360/2430/6.75, 2050/2990/1.4585, 180/790/4.3889, Display blank. Break-even 2.5, margin after ads -106 and -854 (Generic Search). ROI 1.3977, CPA 37.54, 0.00% format 239.77% and F12*100 in that format 23976.83% (Sheets). Text spend: row ROAS still 6.75, paused row #DIV/0!, total #DIV/0!, COUNT 0, COUNTA 9, SUMIFS 0; helper column total 2.3977; helper on "$1,240.50" 1240.5 and on "1.240,50" 1.2405 (Sheets). VALUE("$120.00") returned 120 in a US-locale sheet and #VALUE! in a Chinese (China) locale sheet. Excel itself was not run.

本主題下一篇:查詢與條件求和 VLOOKUP Evaluates to an Out of Bounds Range in Sheets