💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# Excel 数据验证,过滤器,分组 > 原文: [https://www.guru99.com/excel-validation-filters-grouping.html](https://www.guru99.com/excel-validation-filters-grouping.html) 在本教程中,我们将涵盖以下主题。 * [数据验证](#5) * [数据过滤器](#6) * [分组和取消分组](#7) * [将图像添加到电子表格](#4) ## 数据验证 从帮助我们避免可以避免的错误的意义上讲,数据验证非常重要。 假设您正在记录学生考试成绩,并且知道最小值为 0,最大值为 100。您可以利用验证功能来确保仅输入 0 到 100 之间的值。 通过单击工作表底部的加号按钮,在工作簿中添加一个新表。 为 S / N,名称和分数添加一列。 您的工作表应如下所示 <colgroup><col style="width: 66px;"><col style="width: 104px;"><col style="width: 94px;"></colgroup> | **S / N** | **名称** | **得分** | | 1 | 简 | | | 2 | 詹姆士 | | | 3 | 琼斯 | | | 4 | 乔纳森 | | | 5 | 约翰 | | * 单击数据选项卡 * 选择单元格 C2 到 C6(将用于记录分数的单元格) ![Getting Started with Microsoft Excel](https://img.kancloud.cn/b1/77/b17792da73c9e4240be0b7df6d38f81d_330x204.png "Getting Started with Microsoft Excel") * 单击数据验证下拉列表。 * 单击数据验证。 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/20/56/20562ccad029fe549d41a4f077f38784_376x247.png "Getting Started with Microsoft Excel") * 您将获得以下对话窗口 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/cb/2b/cb2bc109a0b420bf0790315130a91689_597x392.png "Getting Started with Microsoft Excel") * 单击错误警报选项卡 * 输入警报标题和消息,如下图所示。 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/f1/c3/f1c39e461384d634ae3b2445ed1fd3de_448x406.png "Getting Started with Microsoft Excel") * 点击确定按钮 * 尝试输入大于 200 的分数。您将收到以下错误消息 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/f9/77/f977a7f290452a55112e30c48f4a1546_327x148.png "Getting Started with Microsoft Excel") ## 数据过滤器 数据过滤器使我们能够获取符合所需标准的数据。 假设我们要显示所有以“ ja”开头或分数小于,大于或等于某个值的学生的成绩,我们可以使用过滤器来获取此类数据。 选择名称和分数列,如下所示 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/db/b3/dbb30b166521be596d8e8a6f88ac9a5d_282x186.png "Getting Started with Microsoft Excel") * 单击功能区上的“数据”选项卡 * 单击排序&过滤器下拉列表,如下图所示 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/3f/0c/3f0cbc248e58c12d437df8e5e539e2d7_636x362.png "Getting Started with Microsoft Excel") * 单击名称过滤器 * 选择文字过滤器 * 选择开始于 * 您将获得以下窗口。 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/4b/79/4b7967c0b5252b2d292f73caa73f7fa5_625x285.png "Getting Started with Microsoft Excel") * 输入“ ja”,然后单击“确定”按钮 * 您应该只能看到 Jane 和 James 的结果。 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/d7/4b/d74bee066b484df93dcba7368ce63a50_549x143.png "Getting Started with Microsoft Excel") ## 分组和取消分组 通过组,我们可以轻松查看并从列或行中隐藏不必要的细节。 除此之外,我们还可以使用组来分析属于同一类别的数据。 让我们用一个例子来说明。 我们将使用上面的学生分数示例。 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/4b/7b/4b7b19329f8ba2109adb0410297ae62f_806x458.png "Getting Started with Microsoft Excel") * 右键单击分数,然后选择“插入列”。 将名称列命名为性别。 * 将 James 换成 Juanita。 珍妮特(Janet)和胡安妮塔(Juanita)的女性。 将男生留给其余的学生。 您的工作表应如下所示。 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/a5/ba/a5ba5f8b441133435568d3950c95057b_362x214.png "Getting Started with Microsoft Excel") 现在,我们将女性分组在一起,显示其平均得分,对男性也是如此。 * 单击功能区上的“数据”选项卡 * 选择所有具有数据的列和行 * 单击组下拉按钮,如下图所示 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/07/5c/075ceebc74a2118c6923c7dc7887a7e0_378x375.png "Getting Started with Microsoft Excel") 您将获得以下窗口 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/31/9a/319aa142c72fcf8de0cc99a97ef7ff65_187x147.png "Getting Started with Microsoft Excel") * 确保选择行选项 * 点击确定按钮 * 您将获得以下预览 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/3c/d1/3cd15987307c31a419f7cb11e080967e_510x211.png "Getting Started with Microsoft Excel") * 现在,我们将计算男性和女性的平均分数 * 选择整个数据,如下所示 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/62/09/62095ea7cba5f0c299b4f8cac04b6df3_380x205.png "Getting Started with Microsoft Excel") 单击“数据”选项卡下的“小计”下拉按钮 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/55/a7/55a7056d4929228b998e17ec41bb6fb3_783x370.png "Getting Started with Microsoft Excel") You will get the following window ![Getting Started with Microsoft Excel](https://img.kancloud.cn/7a/75/7a758b17105010b67b03a60c95b3c690_271x338.png "Getting Started with Microsoft Excel") * 将“每次更改”设置为性别 * 将“使用功能”设置为平均 * 选择“添加小计”以得分 * 点击“确定”按钮 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/2b/6f/2b6fe0ab15ec488dbdaec407cb6fe162_510x301.png "Getting Started with Microsoft Excel") [下载上面的 Excel 代码](https://drive.google.com/uc?export=download&id=0BwL5un1OyjsdZEszc3hKUlpaMDg) ## 将图像添加到电子表格 有时,您希望在 excel 中打印的文件带有信头信息,并带有公司徽标等进行打印。Excel 具有允许您将图像导入 Excel 的功能。 在功能区上的“插入”选项卡下可以找到添加图像的命令。 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/a9/63/a9634a76e4459e1d95c4534e9ad937eb_586x229.png "Getting Started with Microsoft Excel") 您将获得以下对话窗口 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/f6/e0/f6e0eacda8ac94beb8f8d2353271230c_683x371.png "Getting Started with Microsoft Excel") * 您可以浏览到计算机上包含图片的任何文件夹,也可以选择任意图片。 * 您将获得类似于以下所示的结果 ![Getting Started with Microsoft Excel](https://img.kancloud.cn/e8/19/e819b52f5f11f4ed7e6486ce08bb5069_517x480.png "Getting Started with Microsoft Excel") ### 教程练习 4 使用 INSERT 选项卡图片命令将您选择的图片添加到工作表中。 ## 摘要 在本文中,我们学习了如何使用 Excel 执行基本的算术运算,设置数据格式,应用验证规则,过滤数据以及如何利用组进一步分析数据和改进表示形式。