Turn Google Sheets into a powerful database and workflow engine using formulas, Apps Script, and integrations. Use when building systems in Sheets, automatin...
数据来源:ClawHub。 在 ClawSkills 查看
选择你使用的 Agent
方法一:命令行安装(推荐)
推荐(无需提前安装 clawhub)
npx clawhub@latest --dir ~/.claude/skills install spreadsheet-automation或使用 clawhub CLI(需提前安装)
clawhub --dir ~/.claude/skills install spreadsheet-automation⚠️ 需要 Node.js 18+,没有 Node?请使用下方方法二直接下载 ZIP。 安装 Node.js →
方法二:手动下载安装(无需 Node)
下载 ZIP,解压后将文件夹放到以下路径,重启 Agent 即可:
安装路径
~/.claude/skills/spreadsheet-automation/💡解压后将文件夹放到上方路径,重启 Agent 即可生效
--- name: spreadsheet-automation description: Turn Google Sheets into a powerful database and workflow engine using formulas, Apps Script, and integrations. Use when building systems in Sheets, automating data entry, creating dashboards, or replacing expensive tools with spreadsheet-based solutions. Covers advanced formulas, Apps Script basics, integration strategies, and real workflow examples. Trigger on "automate spreadsheet", "Google Sheets automation", "Apps Script", "spreadsheet workflow", "Sheets as database", "automate data entry". ---
Google Sheets isn't just for budgets and lists. With the right formulas, Apps Script, and integrations, it becomes a database, CRM, project tracker, analytics dashboard, and workflow engine — all in one free tool. This playbook shows you how to build production-grade systems in Sheets that replace $50-500/month SaaS tools.
---
Not every workflow belongs in Sheets. Here's when Sheets is the right tool.
Good use cases for Sheets automation:
Bad use cases (use a real database or tool instead):
Audit your current manual work (10 min):
Low-hanging fruit checklist:
---
Most Sheets automation starts here. Master these formulas and you can build 80% of what you need without Apps Script.
QUERY (SQL-like queries in Sheets):
=QUERY(A1:D100, "SELECT A, B, C WHERE D > 1000 ORDER BY C DESC")
SELECT [columns] WHERE [condition] ORDER BY [column] LIMIT [number]IMPORTRANGE (pull data from other sheets):
=IMPORTRANGE("spreadsheet_url", "Sheet1!A1:D100")
ARRAYFORMULA (apply formula to entire column):
=ARRAYFORMULA(IF(A2:A="",,B2:B*C2:C))
VLOOKUP / XLOOKUP (lookup values from another table):
=VLOOKUP(A2, Sheet2!A:B, 2, FALSE)
FILTER (dynamic filtering):
=FILTER(A2:D100, D2:D100>1000, C2:C100="Active")
UNIQUE (remove duplicates):
=UNIQUE(A2:A100)
REGEXEXTRACT (extract patterns from text):
=REGEXEXTRACT(A2, "[0-9]{3}-[0-9]{3}-[0-9]{4}")
IMPORTXML / IMPORTHTML (scrape web data):
=IMPORTXML("https://example.com", "//h1")
---
Single-sheet solutions are limited. Real power comes from connecting multiple sheets into a system.
System architecture pattern:
SHEET 1: Data Entry (input form or manual entry)
↓
SHEET 2: Master Database (cleaned, validated, enriched)
↓
SHEET 3: Dashboard (charts, summaries, insights)
↓
SHEET 4: Exports/Reports (formatted for sharing)
Example: Simple CRM in Sheets
Sheet 1: Lead Entry Form
Sheet 2: Master Lead Database
IMPORTRANGE or direct reference=IF(ISBLANK(D2), "New", D2) (auto-set status to "New" if empty)Sheet 3: Dashboard
=COUNTA(MasterDB!A2:A)=COUNTIF(MasterDB!E2:E, ">="&TODAY()-7)=COUNTIF(MasterDB!D2:D, "Closed")/COUNTA(MasterDB!A2:A)Sheet 4: Weekly Report
=FILTER(MasterDB!A2:E, MasterDB!E2:E>=TODAY()-7)Key principles:
---
Apps Script lets you do things formulas can't: send emails, make API calls, create custom menus, run code on a schedule.
When to use Apps Script:
How to access Apps Script:
function onEdit(e) {
var sheet = e.source.getActiveSheet();
// Only run on "Lead Entry" sheet
if (sheet.getName() !== "Lead Entry Form") return;
// Get edited row and column
var row = e.range.getRow();
var col = e.range.getColumn();
// If new row added (row > 1 to skip header)
if (row > 1 && col === 1) {
var name = sheet.getRange(row, 1).getValue();
var email = sheet.getRange(row, 2).getValue();
// Send email notification
MailApp.sendEmail({
to: "[email protected]",
subject: "New Lead: " + name,
body: "Name: " + name + "\nEmail: " + email
});
}
}
How to set up:
onEdit → From spreadsheet → On edit → Savefunction fetchAPIData() {
var url = "https://api.example.com/data";
var options = {
"method": "GET",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
};
var response = UrlFetchApp.fetch(url, options);
var data = JSON.parse(response.getContentText());
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("API Data");
// Clear existing data
sheet.clear();
// Write headers
sheet.appendRow(["ID", "Name", "Value"]);
// Write data rows
data.forEach(function(item) {
sheet.appendRow([item.id, item.name, item.value]);
});
}
How to set up:
url and YOUR_API_KEYfetchAPIData → Time-driven → Hour timer → Every hourfunction archiveOldRows() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sourceSheet = ss.getSheetByName("Active Tasks");
var archiveSheet = ss.getSheetByName("Archive");
var data = sourceSheet.getDataRange().getValues();
var today = new Date();
var cutoffDate = new Date(today.getTime() - (30 * 24 * 60 * 60 * 1000)); // 30 days ago
// Start from row 2 (skip header)
for (var i = data.length - 1; i >= 1; i--) {
var rowDate = new Date(data[i][3]); // Column D = date
if (rowDate < cutoffDate) {
// Copy row to archive
archiveSheet.appendRow(data[i]);
// Delete from source
sourceSheet.deleteRow(i + 1);
}
}
}
Common Apps Script patterns:
sheet.getRange("A1:D10").getValues()sheet.getRange("A1").setValue("Hello")sheet.appendRow([val1, val2, val3])MailApp.sendEmail(to, subject, body)UrlFetchApp.fetch(url, options)new Date()Apps Script resources:
---
Sheets becomes 10x more powerful when integrated with other tools.
Integration strategies:
Use case: Collect data from forms, webhooks, or other tools → write to Sheets for storage
Example workflow (Zapier/Make):
TRIGGER: New Typeform submission
ACTION 1: Add row to Google Sheets
ACTION 2: Send email confirmation (optional)
Example workflow (Webhook → Sheets):
TRIGGER: Webhook received (from website, Stripe, etc.)
ACTION: Parse JSON → Write to Google Sheets
Use case: When row added/updated in Sheets → trigger action elsewhere
Example workflow:
TRIGGER: New row in Google Sheets (check every 15 min)
CONDITION: Status column = "Approved"
ACTION: Create task in Asana / Send email / Post to Slack
Use case: Sheets pulls data from Tool A, processes it, pushes to Tool B
Example workflow (sync CRM to email tool):
TRIGGER: New row in Google Sheets (CRM export)
CONDITION: Email column not empty + Tag column = "Newsletter"
ACTION: Add contact to ConvertKit / Mailchimp
Best tools for Sheets integration:
Common integrations:
---
Problem: Manually tracking invoices sent, paid, and overdue
Solution:
Sheet 1: Invoice Log
Formula magic:
Status = =IF(G2="Paid", "Paid", IF(E2<TODAY(), "Overdue", "Pending"))
Days Overdue = =IF(E2<TODAY(), TODAY()-E2, 0)
Apps Script (run daily):
function sendOverdueReminders() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Invoice Log");
var data = sheet.getDataRange().getValues();
for (var i = 1; i < data.length; i++) {
var status = data[i][6]; // Status column
var client = data[i][1];
var invoiceNum = data[i][0];
var amount = data[i][2];
if (status === "Overdue") {
MailApp.sendEmail({
to: "[email protected]",
subject: "Reminder: Invoice " + invoiceNum + " Overdue",
body: "Hi " + client + ",\n\nInvoice " + invoiceNum + " for $" + amount + " is overdue. Please remit payment.\n\nThank you!"
});
}
}
}
Trigger: Time-driven, daily at 9am
---
Problem: Manually qualifying leads based on fit
Solution:
Sheet 1: Lead Data
Formula scoring:
Score = =
IF(B2="Enterprise", 30, IF(B2="Mid-Market", 20, 10)) +
IF(C2="SaaS", 20, IF(C2="E-commerce", 15, 5)) +
IF(D2>10000, 30, IF(D2>5000, 20, 10)) +
IF(E2="Immediate", 20, IF(E2="This Quarter", 10, 0))
Priority = =IF(F2>=70, "Hot", IF(F2>=50, "Warm", "Cold"))
Automation (Zapier):
TRIGGER: New row in Google Sheets
CONDITION: Priority = "Hot"
ACTION 1: Add to Pipedrive as high-priority deal
ACTION 2: Send Slack notification to sales team
---
Problem: Manually tracking and scheduling social posts
Solution:
Sheet 1: Content Calendar
Apps Script (run hourly):
function publishScheduledPosts() {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Content Calendar");
var data = sheet.getDataRange().getValues();
var now = new Date();
for (var i = 1; i < data.length; i++) {
var scheduleDate = new Date(data[i][0]);
var status = data[i][4];
// If scheduled for now or past, and not yet published
if (scheduleDate <= now && status === "Scheduled") {
var platform = data[i][1];
var text = data[i][2];
// Call API to post (Twitter, LinkedIn, etc.)
postToAPI(platform, text);
// Mark as published
sheet.getRange(i+1, 5).setValue("Published");
}
}
}
function postToAPI(platform, text) {
// Example: Twitter API call
var url = "https://api.twitter.com/2/tweets";
var payload = JSON.stringify({"text": text});
var options = {
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR_TWITTER_TOKEN",
"Content-Type": "application/json"
},
"payload": payload
};
UrlFetchApp.fetch(url, options);
}
---
When Sheets starts to slow down:
Problem: Sheet with 10K+ rows, complex formulas → slow to load/edit
Solutions:
A2:A1000 instead of A:A (entire column)When to migrate away from Sheets:
Backup strategy:
---
ROI calculation:
Time Saved per Month (hours) = (Minutes per task / 60) × Frequency per month
Monthly Value = Time Saved × Hourly Rate
Setup Cost = (Setup time in hours × Hourly Rate) + Tool costs
Payback Period (months) = Setup Cost / Monthly Value
If payback period < 3 months → Definitely worth it
If payback period > 6 months → Probably not worth it
Example:
Task: Manually entering form submissions into CRM (15 min, 40x/month = 10 hours/month saved)
Your hourly rate: $50/hour
Monthly value saved: $500
Setup time: 2 hours
Setup cost: $100 (time) + $0 (Google Forms + Sheets are free)
Payback: $100 / $500 = 0.2 months → Absolutely worth it
Rule: If it saves 5+ hours/month, automate it.
---
NOW(), TODAY(), RAND() recalculate constantly and slow down sheets. Use sparingly.安装 Spreadsheet Automation 后,可以对 AI 说这些话来触发它
Help me get started with Spreadsheet Automation
Explains what Spreadsheet Automation does, walks through the setup, and runs a quick demo based on your current project
Use Spreadsheet Automation to turn Google Sheets into a powerful database and workflow engine usi...
Invokes Spreadsheet Automation with the right parameters and returns the result directly in the conversation
What can I do with Spreadsheet Automation in my marketing & growth workflow?
Lists the top use cases for Spreadsheet Automation, with example commands for each scenario
将技能文件夹放到 ~/.claude/skills/spreadsheet-automation/ 目录(个人级,所有项目可用),或 .claude/skills/spreadsheet-automation/(项目级)。重启 AI 客户端后,用 /spreadsheet-automation 主动调用,或让 AI 根据上下文自动发现并使用。
Spreadsheet Automation 支持 Claude、Cursor、OpenClaw,可与这些 AI 平台无缝集成,扩展其能力。
Spreadsheet Automation 可免费安装使用。请查阅仓库了解许可证信息。
Turn Google Sheets into a powerful database and workflow engine using formulas, Apps Script, and integrations. Use when building systems in Sheets, automatin...
Spreadsheet Automation 属于「Marketing & Growth」分类,该分类的技能帮助 AI 智能体在此领域执行专业任务。
Automate my marketing & growth tasks using Spreadsheet Automation
Identifies repetitive steps in your workflow and sets up Spreadsheet Automation to handle them automatically