Marketing attribution is one of the most argued-about topics in any growth team. Which channel gets credit for a sale? The answer depends on your attribution model. This guide shows you how to build both first-touch and last-touch attribution reports in Google Sheets so you can see channel performance from multiple angles.
Your Data Structure
You need two datasets joined together: lead source data (which channel brought each lead in) and deal data (which leads became customers and how much they were worth).
Your lead table needs: lead ID, name, first-touch source (the channel that brought them in), last-touch source (the channel that was active when they converted), and lead date.
Your deal table needs: deal ID, lead ID, close date, and deal value.
Join them with VLOOKUP on the lead ID to pull source data into your deal table.
First-Touch Attribution
First-touch gives 100% of the credit to the channel that first brought the lead in. Use SUMIFS on your joined deal table:
=SUMIFS(DealTable!D:D, DealTable!E:E, A2, DealTable!C:C, ">="&DATE(2026,1,1))
Where D is deal value, E is first-touch source, A2 is the channel name, and the date filter covers your reporting period. Do this for every channel to see total revenue attributed to each first-touch source.
Last-Touch Attribution
Same formula but using the last-touch source column instead. Compare first-touch and last-touch side by side — channels that appear more valuable in last-touch than first-touch are good closers. Channels that appear more in first-touch are good at generating awareness.
Cost Per Acquisition by Channel
Add your marketing spend by channel for the same period (from your ad platforms or budget tracker). Calculate CPA:
=B2/C2
Where B2 is spend and C2 is customers acquired from that channel. Compare CPA across channels. A channel with high spend but few customers has a poor CPA. A channel with low spend but many customers is efficient and worth scaling.
ROAS by Channel
Calculate ROAS by dividing attributed revenue by spend:
=D2/B2
Where D2 is attributed revenue and B2 is spend. Sort by ROAS descending to see your most efficient channels at the top.
The Easy Way: Using SheetXAI in Google Sheets
Example 1: You have lead and deal data already in the spreadsheet.
"I have a lead table with first-touch and last-touch sources on Sheet 1 and a deal table on Sheet 2. Build a marketing attribution report showing revenue and customer count by channel for both first-touch and last-touch models, plus CPA and ROAS by channel."
SheetXAI reads both sheets, joins the data, calculates both attribution models, and builds the channel comparison.
Example 2: Your data lives across your CRM and ad platforms.
"Pull closed deals from HubSpot with lead source data, and pull spend from Google Ads and Meta. Build a marketing attribution report showing first-touch and last-touch revenue by channel and ROAS."
SheetXAI connects to all sources and builds the full attribution report.
Try SheetXAI free and see what it builds for you.
Published May 2026. See also: How to Track Ad Spend Across Google and Meta in Google Sheets, How to Build a KPI Dashboard in Google Sheets, and Google Sheets AI Guide.