Skip to Content
学习 Excel 生成式人工智能工具 (Chinese Edition)
book

学习 Excel 生成式人工智能工具 (Chinese Edition)

by Angelica Lo Duca
April 2026
Intermediate
390 pages
5h 31m
Chinese
O'Reilly Media, Inc.
Content preview from 学习 Excel 生成式人工智能工具 (Chinese Edition)

第 4 章. ChatGPT 的高级 操作

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

当我在21世纪初开始编程时,修复代码中的错误是一项真正的挑战。 如果程序无法正常运行,你甚至不知道该从何处着手。你可能需要花费数小时,有时甚至数天,逐行检查代码,只为找到那个隐藏的错误。 这时,一位同事或朋友突然出现,只需瞥一眼,就能找出问题所在,并指给你看,仿佛这是世上最显而易见的事情。而你,夹在难以置信与感激之间,会由衷地向他们致谢。

随后互联网、Web 2.0 和编程论坛应运而生。如果你的代码报错,只需使用搜索引擎,迟早会发现有人遇到过同样的问题并已解决。调试时间因此大幅缩短。

如今,有了ChatGPT,一切变得更快。只需粘贴代码并询问错误所在,几分钟内——有时甚至几秒钟——你就能得到解决方案。回想二十年前,我曾为一个 bug 耗费整整一天,如今的进步令人惊叹。但这还不是全部。借助生成式人工智能,你不再需要亲自编写代码;ChatGPT 会直接为你完成。 只需描述问题,它就会返回可直接使用的代码,无论是用于 Python、Java 或 C# 等编程语言,还是用于在 Excel 中创建高级高效的公式。而这正是本章将向您展示的内容。更确切地说,本章涵盖以下主题:

  • 使用 ChatGPT 分析数据集

  • 使用 ChatGPT 处理数据透视表

  • 结合使用 ChatGPT 和宏

  • 使用 ChatGPT 编写 VBA 代码

让我们从第一个主题开始,即使用 ChatGPT 分析数据集。

使用 ChatGPT 分析数据集

上一章介绍了如何利用 AI 协助编写或理解公式。然而,仅仅拥有公式是不够的,仅仅懂得如何使用它们也不够。你还需要运用公式来执行恰当的数据分析。例如,你可能拥有一个完美的数据集,也精通所有 Excel 公式,却不知道该向数据集提出什么问题,也不知道该使用什么公式来从数据中提取重要信息。 其实,AI(特别是 ChatGPT)能帮你解决这个问题。在本节中,你将看到 AI 如何分析数据集并生成高级公式。 要分析数据集,请按照图 4-1 所示的流程操作。

Diagram illustrating a workflow for dataset analysis, starting from a dataset to category identification, followed by relevant questions, answer generation, and answers implementation.
图 4-1. 数据集分析的工作流程

一个典型的详细工作流程可能如下所示:

  1. 首先在 Excel 中打开您的数据集。提取包含列名及部分示例行(或若数据集不大,可直接使用完整数据集)的片段。

  2. 将其上传至 ChatGPT。(或者,如前几章所示,您可以向 ChatGPT 提供有关该数据集的背景信息。)

  3. 请 ChatGPT 从数据集中提取类别。 类别的示例包括金融、环境、健康、社会等。此步骤对于帮助 ChatGPT 进行下一步操作至关重要。

  4. 请让ChatGPT根据您的数据集定义相关问题。例如,表4-1列出了根据数据所属类别可能提出的一些问题。

  5. 确定问题后,请让 ChatGPT 使用 Excel 公式来回答这些问题。

  6. 告知 ChatGPT 将这些回答应用到您的原始数据集中,并使其可供下载。

表 4-1. 基于数据类别的可能问题列表

分类

请求

健康

某种疾病的主要风险因素有哪些?

诊断结果在时间和空间上存在哪些差异?

某项特定治疗的效果如何?

金融

金融市场的趋势如何?

哪些因素会影响股价? ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

向量数据库 (Chinese Edition)

向量数据库 (Chinese Edition)

Nitin Borwankar

Publisher Resources

ISBN: 0642572371579