Real-world recipes · Marketing analytics

Customer acquisition cost (CAC) by channel

In Excel, you'd reach for
fxTwo pivot tables (spend, signups) and a VLOOKUP between them

CAC = marketing spend on a channel ÷ customers that channel brought in. The spend lives in campaigns; the customers live in customers. Total each one per channel first, then join the totals together.

Try itEdit the query, then Run
channeltotal_spendcustomerscac
paid_search2702084321.67
social1678074226.76
partner1030066156.06
referral39405867.93
organic_searchempty138empty

5 rows

organic_search has no spend row, so the LEFT JOIN keeps it with an empty CAC instead of dropping it. That's the "keep the #N/A rows" join from the VLOOKUP lesson doing real work.

Your turn

Total marketing spend per month, as spend, in month order.

This page on one card

Customer acquisition cost (CAC) by channel: the Excel way (Two pivot tables (spend) and the SQL query, side by side
Customer acquisition cost (CAC) by channel, on one card: the Excel way and the SQL. Download · Save to Pinterest
The practice data (7 tables)

See every column and sample rows