Skip to main content

Aggregate marketing spend data with custom pivots & VLOOKUPs in Google Sheets

Workflow preview

Workflow preview
100%
Aggregate marketing spend data with custom pivots & VLOOKUPs in Google Sheets preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

This workflow transforms raw marketing data from Google Sheets into a pivot like summary table . It merges lookup data, groups spend by name, and appends the results into a clean reporting tab β€” al...

Best for

  • Document Extraction automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.manualtrigger, n8n-nodes-base.googlesheets, n8n-nodes-base.summarize, n8n-nodes-base.merge, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Robert Breen.

Original n8n.io source

1.1 Workflow description

Title
Aggregate marketing spend data with custom pivots & VLOOKUPs in Google Sheets
Workflow name
Aggregate marketing spend data with custom pivots & VLOOKUPs in Google Sheets

This workflow transforms raw marketing data from Google Sheets into a pivot-like summary table. It merges lookup data, groups spend by name, and appends the results into a clean reporting tab β€” all automatically, without needing to manually build pivot tables in Sheets.


πŸ§‘β€πŸ’» Who’s it for

  • Marketing analysts who track channel spend across campaigns
  • Small businesses that rely on Google Sheets for reporting
  • Teams that need automated daily rollups without rebuilding pivot tables manually

βš™οΈ How it works

  1. Get Marketing Data (Google Sheets) – Pulls raw spend data.
  2. Vlookup Data (Google Sheets) – Brings in reference/lookup fields (e.g., channel labels).
  3. Merge Tables – Joins marketing data and lookup data on the Channel column.
  4. Summarize – Groups data by Name and sums up Spend ($).
  5. Clear Sheet – Wipes the reporting tab to avoid duplicates.
  6. Append to Pivot Sheet – Writes the aggregated results into the "render pivot" sheet.

The result: a pivot-style summary table inside Google Sheets, automatically refreshed by n8n.


πŸ”‘ Setup Instructions

1) Connect Google Sheets (OAuth2)

  1. In n8n β†’ Credentials β†’ New β†’ Google Sheets (OAuth2)
  2. Sign in with your Google account and grant access
  3. In each Google Sheets node, select your Spreadsheet and the appropriate Worksheet:
    • data (raw spend)
    • Lookup (channel reference table)
    • render pivot (output tab)

2) Configure Summarize Node

  • Group by: Name
  • Summarize: Spend ($) β†’ sum

3) Test the Workflow

  1. Execute the workflow manually
  2. Check your "render pivot" tab β€” it should display aggregated spend by Name

πŸ› οΈ How to customize

  • Change grouping fields (e.g., by Channel, Campaign, or Region)
  • Add more aggregations (e.g., average CPC, max impressions)
  • Use the Merge node to join extra data sources before summarizing
  • Schedule execution to run daily for fresh rollups

πŸ“‹ Requirements

  • n8n (Cloud or self-hosted)
  • Google Sheets account with structured data in data and Lookup tabs

πŸ“¬ Contact

Need help customizing this (e.g., filtering by campaign, sending reports by email, or formatting your pivot)?

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When clicking β€˜Execute workflow’

Type / Role
n8n-nodes-base.manualTrigger - manualTrigger
Config choices
Version 1

Block 2 - Clear sheet

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 3 - Pivot

Type / Role
n8n-nodes-base.summarize - summarize
Config choices
Version 1.1

Block 4 - Get Marketing Data

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 5 - Vlookup Data

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 6 - Merge Tables (Vlookup)

Type / Role
n8n-nodes-base.merge - merge
Config choices
Version 3.2

Block 7 - Create "Pivot Table" Kindof

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - Sticky Note55

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 9 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 10 - Sticky Note65

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Aggregate marketing spend data with custom pivots & VLOOKUPs in Google Sheets
Complexity intermediate
Nodes 10
Categories Document Extraction
Author Robert Breen
Published 30 Aug 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/8069/8069.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Aggregate marketing spend data with custom pivots & VLOOKUPs in Google Sheets do?

This workflow transforms raw marketing data from Google Sheets into a pivot like summary table . It merges lookup data, groups spend by name, and appends the results into a clean reporting tab β€” al...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Document Extraction use case.