AutomationFlowsData & Sheets › Sum or Aggregate Spreadsheet Column Data

Sum or Aggregate Spreadsheet Column Data

Original n8n title: Sum or Aggregate a Column of Spreadsheet or Table Data

Sum Or Aggregate A Column Of Spreadsheet Or Table Data. Uses manualTrigger. Event-driven trigger; 3 nodes.

Event trigger★★★★☆ complexity3 nodes
Data & Sheets Trigger: Event Nodes: 3 Complexity: ★★★★☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "name": "On clicking 'execute'",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        220,
        80
      ],
      "parameters": {},
      "typeVersion": 1
    },
    {
      "name": "Mock data",
      "type": "n8n-nodes-base.function",
      "position": [
        420,
        80
      ],
      "parameters": {
        "functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n\n\nreturn [ { json: { amount_USD: 50 } }, { json: { amount_USD: 20 } }, { json: { amount_USD: 60 } } ];"
      },
      "typeVersion": 1
    },
    {
      "name": "Summing function",
      "type": "n8n-nodes-base.function",
      "position": [
        660,
        80
      ],
      "parameters": {
        "functionCode": "// Code here will run only once, no matter how many input items there are.\n// More info and help: https://docs.n8n.io/nodes/n8n-nodes-base.function\n\n//Setup an empty variable to hold the count\nlet total = 0;\n\n//Loop over the incoming items of data\nfor (item of items) {\n  //For each item of data, add the amount_USD to our total counter\n  total += item.json.amount_USD;\n}\n\n//Returns a well formed JSON object with just the total_value . You can either add more data to this returned object OR use the set node afterwards to do it in a no-code way.\nreturn [ { json: { total_value: total } } ];"
      },
      "typeVersion": 1
    }
  ],
  "connections": {
    "Mock data": {
      "main": [
        [
          {
            "node": "Summing function",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "On clicking 'execute'": {
      "main": [
        [
          {
            "node": "Mock data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

Sum Or Aggregate A Column Of Spreadsheet Or Table Data. Uses manualTrigger. Event-driven trigger; 3 nodes.

Source: https://github.com/Zie619/n8n-workflows — original creator credit. Request a take-down →

More Data & Sheets workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Data & Sheets

TrackCollect_deeper. Uses googleSheets, httpRequest, @n-octo-n/n8n-nodes-json-database, itemLists. Event-driven trigger; 80 nodes.

Google Sheets, HTTP Request, @N Octo N/N8N Nodes Json Database +1
Data & Sheets

Automate your entire email experimentation workflow with this AI-powered A/B testing orchestrator 🚀. This n8n automation generates two intelligent email variants using AI, sends campaigns through Mail

HTTP Request, Google Sheets Trigger, Notion
Data & Sheets

This template is ideal for solo store owners, eCommerce marketers, automation beginners, or anyone using Shopify and Gmail who wants to recover lost revenue without coding.

HTTP Request, Gmail, Twilio +3
Data & Sheets

PCN. Uses googleSheets, httpRequest, @n-octo-n/n8n-nodes-json-database, itemLists. Event-driven trigger; 60 nodes.

Google Sheets, HTTP Request, @N Octo N/N8N Nodes Json Database +3
Data & Sheets

Product Ad Machine. Uses googleDrive, googleSheets, httpRequest, @ffmpeg-micro/n8n-nodes-ffmpeg-micro. Event-driven trigger; 60 nodes.

Google Drive, Google Sheets, HTTP Request +2