microsoft-excel

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Microsoft Excel Skill

Microsoft Excel 技能

Overview

概述

Claude can work with Microsoft Excel Online to create spreadsheets, analyze data, build formulas, create charts, and automate calculations. Includes support for pivot tables, conditional formatting, and data analysis tools.
Claude可以在Microsoft Excel Online中处理电子表格,包括创建表格、分析数据、构建公式、制作图表以及自动化计算。支持数据透视表、条件格式和数据分析工具等功能。

Quick Install

快速安装

bash
curl -sSL https://canifi.com/skills/microsoft-excel/install.sh | bash
Or manually:
bash
cp -r skills/microsoft-excel ~/.canifi/skills/
bash
curl -sSL https://canifi.com/skills/microsoft-excel/install.sh | bash
或者手动安装:
bash
cp -r skills/microsoft-excel ~/.canifi/skills/

Setup

设置

Configure via canifi-env:
bash
undefined
通过canifi-env进行配置:
bash
undefined

First, ensure canifi-env is installed:

首先,确保已安装canifi-env:

canifi-env set MICROSOFT_EMAIL "your-email@outlook.com"
undefined
canifi-env set MICROSOFT_EMAIL "your-email@outlook.com"
undefined

Privacy & Authentication

隐私与认证

Your credentials, your choice. Canifi LifeOS respects your privacy.
您的凭据,您做主。Canifi LifeOS 尊重您的隐私。

Option 1: Manual Browser Login (Recommended)

选项1:手动浏览器登录(推荐)

If you prefer not to share credentials with Claude Code:
  1. Complete the Browser Automation Setup using CDP mode
  2. Login to the service manually in the Playwright-controlled Chrome window
  3. Claude will use your authenticated session without ever seeing your password
如果您不想与Claude Code共享凭据:
  1. 使用CDP模式完成浏览器自动化设置
  2. 在Playwright控制的Chrome窗口中手动登录服务
  3. Claude将使用您的已认证会话,全程不会获取您的密码

Option 2: Environment Variables

选项2:环境变量

If you're comfortable sharing credentials, you can store them locally:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
Note: Credentials stored in canifi-env are only accessible locally on your machine and are never transmitted.
如果您愿意共享凭据,可以将其存储在本地:
bash
canifi-env set SERVICE_EMAIL "your-email"
canifi-env set SERVICE_PASSWORD "your-password"
注意:存储在canifi-env中的凭据仅能在您的本地机器上访问,绝不会被传输。

Capabilities

功能

  • Create and edit spreadsheets
  • Enter and format data
  • Build formulas and functions
  • Create charts and visualizations
  • Apply conditional formatting
  • Create pivot tables
  • Sort and filter data
  • Use data validation
  • Import and export data
  • Create named ranges
  • Protect sheets and workbooks
  • Collaborate in real-time
  • 创建和编辑电子表格
  • 输入和格式化数据
  • 构建公式和函数
  • 创建图表和可视化效果
  • 应用条件格式
  • 创建数据透视表
  • 排序和筛选数据
  • 使用数据验证
  • 导入和导出数据
  • 创建命名区域
  • 保护工作表和工作簿
  • 实时协作

Usage Examples

使用示例

Example 1: Create Spreadsheet

示例1:创建电子表格

User: "Create an expense tracker in Excel"
Claude: Creates new workbook "Expense Tracker", adds columns for
        Date, Category, Description, Amount. Adds SUM formula for total.
        Returns: "Created expense tracker: [link]"
用户:"在Excel中创建一个费用跟踪器"
Claude:创建新工作簿“Expense Tracker”,添加日期、类别、描述、金额列。添加求和公式计算总计。
        返回:"已创建费用跟踪器:[链接]"

Example 2: Analyze Data

示例2:数据分析

User: "Create a pivot table from my sales data"
Claude: Selects data range, inserts pivot table,
        configures rows, columns, and values.
        Confirms: "Pivot table created showing sales by region and product"
用户:"根据我的销售数据创建一个数据透视表"
Claude:选择数据范围,插入数据透视表,
        配置行、列和值。
        确认:"已创建按地区和产品展示销售额的数据透视表"

Example 3: Create Chart

示例3:创建图表

User: "Make a line chart showing revenue trends"
Claude: Selects revenue data, inserts line chart,
        adds titles and labels. Confirms: "Revenue trend chart created"
用户:"制作一个显示收入趋势的折线图"
Claude:选择收入数据,插入折线图,
        添加标题和标签。确认:"收入趋势图表已创建"

Example 4: Apply Formulas

示例4:应用公式

User: "Add a formula to calculate profit margin in column E"
Claude: Enters formula =(D2-C2)/D2 for margin calculation,
        applies to all rows. Confirms: "Profit margin formula applied"
用户:"添加一个公式计算E列的利润率"
Claude:输入公式=(D2-C2)/D2进行利润率计算,
        应用到所有行。确认:"利润率公式已应用"

Authentication Flow

认证流程

  1. Claude navigates to excel.office.com via Playwright MCP
  2. Authenticates with MICROSOFT_EMAIL if needed
  3. Handles 2FA if prompted (notifies user via iMessage)
  4. Maintains session for spreadsheet operations
  1. Claude通过Playwright MCP导航至excel.office.com
  2. 如有需要,使用MICROSOFT_EMAIL进行认证
  3. 若提示双因素认证,通过iMessage通知用户
  4. 维持会话以进行电子表格操作

Selectors Reference

选择器参考

javascript
// New workbook
'[aria-label="New blank workbook"]'

// Workbook name
'[aria-label="Workbook name"]'

// Cell input
'.formulabar-input' or 'input[name="Cell"]'

// Active cell
'[aria-selected="true"]'

// Ribbon tabs
'[role="tablist"]'

// Insert tab
'[aria-label="Insert"]'

// Formulas tab
'[aria-label="Formulas"]'

// Data tab
'[aria-label="Data"]'

// Chart button
'[aria-label="Insert chart"]'

// Sort button
'[aria-label="Sort"]'

// Filter button
'[aria-label="Filter"]'
javascript
// 新建工作簿
'[aria-label="New blank workbook"]'

// 工作簿名称
'[aria-label="Workbook name"]'

// 单元格输入
'.formulabar-input' or 'input[name="Cell"]'

// 活动单元格
'[aria-selected="true"]'

// 功能区选项卡
'[role="tablist"]'

// 插入选项卡
'[aria-label="Insert"]'

// 公式选项卡
'[aria-label="Formulas"]'

// 数据选项卡
'[aria-label="Data"]'

// 图表按钮
'[aria-label="Insert chart"]'

// 排序按钮
'[aria-label="Sort"]'

// 筛选按钮
'[aria-label="Filter"]'

Common Formulas

常用公式

=SUM(A1:A10)              // Sum range
=AVERAGE(A1:A10)          // Average
=VLOOKUP(key,range,col,0) // Vertical lookup
=IF(condition,true,false) // Conditional
=COUNTIF(range,criteria)  // Count matching
=SUMIF(range,crit,sum)    // Sum matching
=TEXT(A1,"format")        // Format text
=TODAY()                  // Current date
=CONCATENATE(A1,B1)       // Join text
=SUM(A1:A10)              // 求和范围
=AVERAGE(A1:A10)          // 平均值
=VLOOKUP(key,range,col,0) // 垂直查找
=IF(condition,true,false) // 条件判断
=COUNTIF(range,criteria)  // 统计匹配项
=SUMIF(range,crit,sum)    // 求和匹配项
=TEXT(A1,"format")        // 文本格式化
=TODAY()                  // 当前日期
=CONCATENATE(A1,B1)       // 文本拼接

Error Handling

错误处理

  • Login Failed: Retry 3 times, notify user via iMessage
  • Session Expired: Re-authenticate automatically
  • Workbook Not Found: Search OneDrive, ask for clarification
  • Formula Error: Identify error type, suggest fix
  • Chart Create Failed: Verify data selection, retry
  • Save Failed: Enable AutoSave, retry
  • 登录失败:重试3次,通过iMessage通知用户
  • 会话过期:自动重新认证
  • 未找到工作簿:搜索OneDrive,请求用户澄清
  • 公式错误:识别错误类型,建议修复方案
  • 图表创建失败:验证数据选择,重试
  • 保存失败:启用自动保存,重试

Self-Improvement Instructions

自我改进说明

When you learn a better way to accomplish a task with Excel Online:
  1. Document the improvement in your response
  2. Suggest updating this skill file with the new approach
  3. Include specific formulas or techniques that work better
  4. Note differences from desktop Excel
当您掌握了在Excel Online中完成任务的更优方法时:
  1. 在回复中记录改进内容
  2. 建议使用新方法更新此技能文件
  3. 包含效果更好的特定公式或技术
  4. 注明与桌面版Excel的差异

Notes

注意事项

  • Excel Online auto-saves to OneDrive
  • Some advanced features only in desktop version
  • Co-authoring shows other users' selections
  • Maximum rows: 1,048,576 per sheet
  • Keyboard shortcuts: Ctrl+C/V, Ctrl+Z for undo
  • Power Query limited in online version
  • Macros not supported in online version
  • Can open and edit .xlsx, .xlsm files
  • Excel Online会自动保存至OneDrive
  • 部分高级功能仅在桌面版中提供
  • 共同编辑时会显示其他用户的选择内容
  • 每个工作表最大行数:1,048,576
  • 键盘快捷键:Ctrl+C/V复制粘贴,Ctrl+Z撤销
  • 在线版中Power Query功能受限
  • 在线版不支持宏
  • 可打开和编辑.xlsx、.xlsm文件