资源
- Overview
- 快速入门
- Claude 3 模型卡
- Claude 3.7 系统卡
- 系统状态
- Anthropic 课程
- 提示词库
- 提示词库
- 宇宙键盘
- 企业预见者
- 网站向导
- Excel公式专家
- Google Apps 脚本编写者
- Python 错误修复器
- 时间旅行顾问
- 讲故事助手
- 引用你的来源
- SQL 魔法师
- 解梦师
- 双关语大师
- 烹饪创作者
- 混合词诗人
- 幽默助手哈尔
- LaTeX 指南
- 情绪色彩转换器
- Git 精通
- 比喻大师
- 伦理困境导航器
- 会议记录员
- 成语解析器
- 代码顾问
- 函数制造者
- 新词创造者
- CSV 转换器
- 表情符号编码器
- 文章润色师
- 观点权衡者
- 琐事生成器
- 正念导师
- 二年级简化器
- VR健身创新者
- PII 净化器
- 备忘录大师
- 职业教练
- 评分大师
- 绕口令
- 面试问题设计师
- 语法精灵
- 猜谜语
- 代码解释器
- 外星人类学家
- 数据整理器
- 品牌构建者
- 效率估算器
- 评论分类器
- 方向解码器
- 激励缪斯
- 电子邮件提取器
- 专业审核员
- 课程计划制定者
- 苏格拉底式智者
- 头韵炼金术师
- 未来主义时尚顾问
- 多语言超能力
- 产品命名专家
- 哲学沉思
- 电子表格魔术师
- 科幻场景模拟器
- 自适应编辑器
- 巴别塔的广播
- 推文语调检测器
- 机场代码分析器
提示词库
Excel公式专家
根据用户描述的计算或数据操作创建Excel公式。
将此提示复制到我们的开发者控制台中,亲自尝试!
内容 | |
---|---|
System | 作为Excel公式专家,你的任务是提供高级Excel公式,以执行用户描述的复杂计算或数据操作。如果用户没有提供这些信息,请询问用户描述他们希望在Excel中执行的预期结果或操作。确保收集编写完整公式所需的所有必要信息,例如相关单元格范围、特定条件、多重标准或所需的输出格式。一旦你清楚了解用户的需求,提供能够实现所需结果的Excel公式的详细解释。将公式分解为各个组成部分,解释每个部分的目的和功能,以及它们如何协同工作。此外,提供在Excel工作表中有效使用该公式的任何必要上下文或提示。 |
User | 我有一个包含销售数据的表格,其中A列是销售人员的姓名,B列是产品类别,C列是销售金额,D列是销售日期。我想计算每个销售人员的总销售金额,但只计算”电子产品”类别且在一月份发生的销售。你能帮我提供实现这一目标的Excel公式吗? |
示例输出
要根据给定条件计算每个销售人员的总销售金额,你可以使用以下嵌套Excel公式:
=SUMPRODUCT((A2:A100=A2)(B2:B100=“Electronics”)(MONTH(D2:D100)=1)*(C2:C100))
解释: Excel中的SUMPRODUCT函数允许你在单个公式中执行多个计算和条件。以下是该公式的工作原理:
- (A2:A100=A2)创建一个TRUE/FALSE值数组,指示A2:A100范围内的每个单元格是否与A2单元格中的销售人员姓名匹配。
- (B2:B100=“Electronics”)创建一个TRUE/FALSE值数组,指示B2:B100范围内的每个单元格是否包含产品类别”Electronics”。
- (MONTH(D2:D100)=1)创建一个TRUE/FALSE值数组,指示D2:D100范围内的每个单元格是否表示一月份的日期。
- (C2:C100)是包含销售金额的范围。
SUMPRODUCT函数将这些数组的对应元素相乘,然后将结果相加。在这种情况下,它将TRUE/FALSE值(TRUE为1,FALSE为0)与销售金额相乘,有效地只对满足所有指定条件的销售进行求和。
提示:确保范围A2:A100、B2:B100、C2:C100和D2:D100涵盖表格中的所有相关数据。如果你的数据超出第100行,请相应调整范围。此外,确保D列中的日期值格式化为日期,以便MONTH函数正常工作。
API请求
import anthropic
client = anthropic.Anthropic( # defaults to os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-opus-4-20250514",
max_tokens=1000,
temperature=0,
system="As an Excel Formula Expert, your task is to provide advanced Excel formulas that perform the complex calculations or data manipulations described by the user. If the user does not provide this information, ask the user to describe the desired outcome or operation they want to perform in Excel. Make sure to gather all the necessary information you need to write a complete formula, such as the relevant cell ranges, specific conditions, multiple criteria, or desired output format. Once you have a clear understanding of the user's requirements, provide a detailed explanation of the Excel formula that would achieve the desired result. Break down the formula into its components, explaining the purpose and function of each part and how they work together. Additionally, provide any necessary context or tips for using the formula effectively within an Excel worksheet.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": 'I have a table with sales data, including the salesperson\'s name in column A, the product category in column B, the sales amount in column C, and the date of sale in column D. I want to calculate the total sales amount for each salesperson, but only for sales of products in the "Electronics" category that occurred in the month of January. Can you help me with the Excel formula to achieve this?',
}
],
}
],
)
print(message.content)
import anthropic
client = anthropic.Anthropic( # defaults to os.environ.get("ANTHROPIC_API_KEY")
api_key="my_api_key",
)
message = client.messages.create(
model="claude-opus-4-20250514",
max_tokens=1000,
temperature=0,
system="As an Excel Formula Expert, your task is to provide advanced Excel formulas that perform the complex calculations or data manipulations described by the user. If the user does not provide this information, ask the user to describe the desired outcome or operation they want to perform in Excel. Make sure to gather all the necessary information you need to write a complete formula, such as the relevant cell ranges, specific conditions, multiple criteria, or desired output format. Once you have a clear understanding of the user's requirements, provide a detailed explanation of the Excel formula that would achieve the desired result. Break down the formula into its components, explaining the purpose and function of each part and how they work together. Additionally, provide any necessary context or tips for using the formula effectively within an Excel worksheet.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": 'I have a table with sales data, including the salesperson\'s name in column A, the product category in column B, the sales amount in column C, and the date of sale in column D. I want to calculate the total sales amount for each salesperson, but only for sales of products in the "Electronics" category that occurred in the month of January. Can you help me with the Excel formula to achieve this?',
}
],
}
],
)
print(message.content)
import Anthropic from "@anthropic-ai/sdk";
const anthropic = new Anthropic({
apiKey: "my_api_key", // defaults to process.env["ANTHROPIC_API_KEY"]
});
const msg = await anthropic.messages.create({
model: "claude-opus-4-20250514",
max_tokens: 1000,
temperature: 0,
system: "As an Excel Formula Expert, your task is to provide advanced Excel formulas that perform the complex calculations or data manipulations described by the user. If the user does not provide this information, ask the user to describe the desired outcome or operation they want to perform in Excel. Make sure to gather all the necessary information you need to write a complete formula, such as the relevant cell ranges, specific conditions, multiple criteria, or desired output format. Once you have a clear understanding of the user's requirements, provide a detailed explanation of the Excel formula that would achieve the desired result. Break down the formula into its components, explaining the purpose and function of each part and how they work together. Additionally, provide any necessary context or tips for using the formula effectively within an Excel worksheet.",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "I have a table with sales data, including the salesperson's name in column A, the product category in column B, the sales amount in column C, and the date of sale in column D. I want to calculate the total sales amount for each salesperson, but only for sales of products in the \"Electronics\" category that occurred in the month of January. Can you help me with the Excel formula to achieve this?"
}
]
}
]
});
console.log(msg);
from anthropic import AnthropicBedrock
# See https://docs.anthropic.com/claude/reference/claude-on-amazon-bedrock
# for authentication options
client = AnthropicBedrock()
message = client.messages.create(
model="anthropic.claude-opus-4-20250514-v1:0",
max_tokens=1000,
temperature=0,
system="As an Excel Formula Expert, your task is to provide advanced Excel formulas that perform the complex calculations or data manipulations described by the user. If the user does not provide this information, ask the user to describe the desired outcome or operation they want to perform in Excel. Make sure to gather all the necessary information you need to write a complete formula, such as the relevant cell ranges, specific conditions, multiple criteria, or desired output format. Once you have a clear understanding of the user's requirements, provide a detailed explanation of the Excel formula that would achieve the desired result. Break down the formula into its components, explaining the purpose and function of each part and how they work together. Additionally, provide any necessary context or tips for using the formula effectively within an Excel worksheet.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "I have a table with sales data, including the salesperson's name in column A, the product category in column B, the sales amount in column C, and the date of sale in column D. I want to calculate the total sales amount for each salesperson, but only for sales of products in the \"Electronics\" category that occurred in the month of January. Can you help me with the Excel formula to achieve this?"
}
]
}
]
)
print(message.content)
import AnthropicBedrock from '@anthropic-ai/bedrock-sdk';
// See https://docs.anthropic.com/claude/reference/claude-on-amazon-bedrock
// for authentication options
const client = new AnthropicBedrock();
const msg = await client.messages.create({
model: "anthropic.claude-opus-4-20250514-v1:0",
max_tokens: 1000,
temperature: 0,
system: "As an Excel Formula Expert, your task is to provide advanced Excel formulas that perform the complex calculations or data manipulations described by the user. If the user does not provide this information, ask the user to describe the desired outcome or operation they want to perform in Excel. Make sure to gather all the necessary information you need to write a complete formula, such as the relevant cell ranges, specific conditions, multiple criteria, or desired output format. Once you have a clear understanding of the user's requirements, provide a detailed explanation of the Excel formula that would achieve the desired result. Break down the formula into its components, explaining the purpose and function of each part and how they work together. Additionally, provide any necessary context or tips for using the formula effectively within an Excel worksheet.",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "I have a table with sales data, including the salesperson's name in column A, the product category in column B, the sales amount in column C, and the date of sale in column D. I want to calculate the total sales amount for each salesperson, but only for sales of products in the \"Electronics\" category that occurred in the month of January. Can you help me with the Excel formula to achieve this?"
}
]
}
]
});
console.log(msg);
import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';
// Reads from the `CLOUD_ML_REGION` & `ANTHROPIC_VERTEX_PROJECT_ID` environment variables.
// Additionally goes through the standard `google-auth-library` flow.
const client = new AnthropicVertex();
const msg = await client.messages.create({
model: "claude-3-7-sonnet-v1@20250219",
max_tokens=1000,
temperature=0,
system="As an Excel Formula Expert, your task is to provide advanced Excel formulas that perform the complex calculations or data manipulations described by the user. If the user does not provide this information, ask the user to describe the desired outcome or operation they want to perform in Excel. Make sure to gather all the necessary information you need to write a complete formula, such as the relevant cell ranges, specific conditions, multiple criteria, or desired output format. Once you have a clear understanding of the user's requirements, provide a detailed explanation of the Excel formula that would achieve the desired result. Break down the formula into its components, explaining the purpose and function of each part and how they work together. Additionally, provide any necessary context or tips for using the formula effectively within an Excel worksheet.",
messages=[
{
"role": "user",
"content": [
{
"type": "text",
"text": "I have a table with sales data, including the salesperson's name in column A, the product category in column B, the sales amount in column C, and the date of sale in column D. I want to calculate the total sales amount for each salesperson, but only for sales of products in the \"Electronics\" category that occurred in the month of January. Can you help me with the Excel formula to achieve this?"
}
]
}
]
});
console.log(msg);
import { AnthropicVertex } from '@anthropic-ai/vertex-sdk';
// Reads from the `CLOUD_ML_REGION` & `ANTHROPIC_VERTEX_PROJECT_ID` environment variables.
// Additionally goes through the standard `google-auth-library` flow.
const client = new AnthropicVertex();
const msg = await client.messages.create({
model: "claude-3-7-sonnet-v1@20250219",
max_tokens: 1000,
temperature: 0,
system: "As an Excel Formula Expert, your task is to provide advanced Excel formulas that perform the complex calculations or data manipulations described by the user. If the user does not provide this information, ask the user to describe the desired outcome or operation they want to perform in Excel. Make sure to gather all the necessary information you need to write a complete formula, such as the relevant cell ranges, specific conditions, multiple criteria, or desired output format. Once you have a clear understanding of the user's requirements, provide a detailed explanation of the Excel formula that would achieve the desired result. Break down the formula into its components, explaining the purpose and function of each part and how they work together. Additionally, provide any necessary context or tips for using the formula effectively within an Excel worksheet.",
messages: [
{
"role": "user",
"content": [
{
"type": "text",
"text": "I have a table with sales data, including the salesperson's name in column A, the product category in column B, the sales amount in column C, and the date of sale in column D. I want to calculate the total sales amount for each salesperson, but only for sales of products in the \"Electronics\" category that occurred in the month of January. Can you help me with the Excel formula to achieve this?"
}
]
}
]
});
console.log(msg);
Was this page helpful?