Conditional formatting lets you format cells in an Excel spreadsheet based on the cells’ content. For example, you could have a cell turn red when it contains a number lower than 100. You can also use conditional formatting to highlight an entire row?

通过条件格式设置,您可以基于单元格的内容来格式化Excel电子表格中的单元格。 例如,当单元格包含的数字小于100时,它可能会变成红色。您还可以使用条件格式突出显示整个行吗?

If you’ve never used Conditional Formatting before, you might want to look at Using Conditional Cell Formatting in Excel 2007. It’s for an earlier version of Excel, but the interface really hasn’t changed much. That guide talks about formatting specific cells based on their content. For example, say you use a spreadsheet to track hours that employees have worked. You could use conditional formatting to color cells red where an employee has worked more than eight hours in a particular day.

如果您以前从未使用过条件格式设置,则可能需要查看在Excel 2007中使用条件单元格格式设置。 它用于早期版本的Excel,但界面的确没有太大变化。 该指南讨论了根据特定单元格的内容设置格式。 例如,假设您使用电子表格来跟踪员工的工作时间。 您可以使用条件格式将员工在特定一天工作超过8个小时的单元格涂成红色。

But what if you wanted to use a cell’s value to highlight other cells? In the example we’re using for this article, we’ve got a small spreadsheet with movies and just a couple of details about those movies (to keep thinks simple). We’re going to use conditional formatting to highlight all the rows with movies made before 1980.

但是,如果您想使用一个单元格的值突出显示其他单元格该怎么办? 在本文所使用的示例中,我们有一个包含电影的小型电子表格,并且仅包含有关这些电影的一些详细信息(以保持简单性)。 我们将使用条件格式来突出显示1980年前制作的电影的所有行。

第一步:创建表格 (Step One: Create Your Table)

Obviously, the first thing you need is a simple table containing your data. The data doesn’t have to be text-only; you can use formulas freely. At this point, your table has no formatting at all:

显然,您需要的第一件事是一个包含数据的简单表。 数据不必是纯文本的。 您可以自由使用公式。 此时,您的表完全没有格式:

第二步:格式化表格 (Step Two: Format Your Table)

Now it’s time to format your table, if you want. You can use Excel’s “simple” formatting tools or take a more hands-on approach, but it’s best only to format only those parts that won’t be affected by conditional formatting. In our case, we can safely set a border for the table, as well as format the header line.

如果需要,现在是时候格式化表格了。 您可以使用Excel的“简单”格式化工具,也可以采用更实际的方法,但是最好仅格式化那些不受条件格式化影响的部分。 在我们的情况下,我们可以安全地为表格设置边框,以及设置标题行的格式。

第三步:创建条件格式规则 (Step Three: Create The Conditional Formatting Rules)

Now we come to the meat and potatoes. As we said at the outset, if you’ve never used conditional formatting before, you should probably check out our earlier primer on the subject and once you’ve got that down, come back here. If you’re already somewhat familiar with conditional formatting (or just adventurous), let’s forge on.

现在我们来谈谈肉和土豆。 就像我们一开始所说的,如果您以前从未使用过条件格式,则可能应该查看有关该主题的更早的入门知识,一旦发现该问题,请回到此处。 如果您已经对条件格式有所了解(或者只是冒险),那就继续吧。

Select the first cell in the first row you’d like to format, click the “Conditional Formatting” button in the “Styles” section of the “Home” tab, and then select “Manage Rules” from the dropdown menu.

选择要格式化的第一行中的第一个单元格,单击“主页”选项卡的“样式”部分中的“条件格式”按钮,然后从下拉菜单中选择“管理规则”。

In the “Conditional Formatting Rules Manager” window, click the “New Rule” button.

在“条件格式规则管理器”窗口中,单击“新规则”按钮。

In the “New Formatting Rule” window, select the “Use a formula to determine which cells to format” option. This is the trickiest part. Your formula must evaluate to “True” for the rule to apply, and must be flexible enough so you could use it across your entire table later on. Here, we’re using the formula:

在“新格式设置规则”窗口中,选择“使用公式确定要格式化的单元格”选项。 这是最棘手的部分。 您的公式必须计算为“ True”才能应用该规则,并且必须足够灵活,以便以后可以在整个表中使用它。 在这里,我们使用公式:

=$D4<1980

The =$D4 part of the formula denotes the address of the cell I want to examine. D is the column (with the movie release date), and 4 is my current row. Note the dollar sign before the D . If you don’t include this symbol, then when you apply conditional formatting to the next cell, it would examine E5. Instead, you need to specify have a “fixed” column ( $D ) but a “flexible” row ( 4 ), because you are going to apply this formula across multiple rows.

公式的=$D4部分表示我要检查的单元格的地址。 D是列(带有电影上映日期),而4是我当前的行。 注意D前面的美元符号。 如果不包括此符号,则当您将条件格式应用于下一个单元格时,它将检查E5。 相反,您需要指定一个“固定”列( $D )但一个“灵活”行( 4 ),因为您将在多个行上应用此公式。

The <1980 part of the formula is the condition that has to be met. In this case, we’re going for a simple condition—the number in the release date column should be less than 1980. Of course, you can use much more complex formulas if you need to.

公式的<1980部分是必须满足的条件。 在这种情况下,我们需要一个简单的条件-发布日期列中的数字应小于1980。当然,如果需要,可以使用更复杂的公式。

So in English, our formula is true whenever the cell in column D in the current row has a value less than 1980.

因此,用英语来说,只要当前行D列中的单元格的值小于1980,我们的公式就成立。

Next, you’ll define the formatting that happens if the formula is true. In the same “New Formatting Rule” window, click the “Format” button.

接下来,您将定义公式为true时发生的格式。 在同一“新格式设置规则”窗口中,单击“格式”按钮。

In the “Format Cells” window, go through the tabs and tweak the settings until you get the look you want. In our example, we’re just going to change the fill color to green on the “Fill” tab. When you’re done applying your formatting, click the “OK” button.

在“设置单元格格式”窗口中,浏览选项卡并调整设置,直到获得所需的外观。 在我们的示例中,我们将要在“填充”选项卡上将填充颜色更改为绿色。 套用格式后,请按一下[确定]按钮。

Back in the “New Formatting Rule” window, you can now see a preview of your cell. If you’re happy with the way everything looks, click the “OK” button.

返回“新格式设置规则”窗口,现在您可以看到单元格的预览。 如果您对所有外观都满意,请单击“确定”按钮。

You should now be back to the “Conditional Formatting Rules Manager” window. Move the window a bit until you can see your spreadsheet behind it, and then click the “Apply” button. If the formatting of your selected cell changes, that means your formula is correct. If the formatting doesn’t change, you need to go a few steps back and tweak your formula until it does work. Here, you can see that our formula worked, and the cell we selected is now filled in green.

现在,您应该回到“条件格式规则管理器”窗口。 稍微移动窗口,直到可以看到其后面的电子表格,然后单击“应用”按钮。 如果所选单元格的格式发生更改,则表示您的公式正确。 如果格式没有改变,则需要向后退几步并调整公式,直到它起作用为止。 在这里,您可以看到我们的公式有效,并且我们选择的单元格现在用绿色填充。

Now that you have a working formula, it’s time to apply it across the entire table. As you can see above, right now the formatting applies only to the cell we started off with. In the “Conditional Formatting Rules Manager” window (which should still be open), click the up arrow to the right of the “Applies To” field.

现在您有了一个有效的公式,是时候将其应用于整个表格了。 如您在上方所见,现在格式化仅适用于我们开始使用的单元格。 在“条件格式设置规则管理器”窗口(应仍打开)中,单击“适用于”字段右侧的向上箭头。

The “Conditional Formatting Rules Manager” window collapses, giving you access to your spreadsheet. Drag to resize the current selection across the entire table (except for the headings).

“条件格式设置规则管理器”窗口折叠起来,使您可以访问电子表格。 拖动以在整个表中调整当前选择的大小(标题除外)。

When you’re done, click the down arrow to the right of the address field to get back to the full “Conditional Formatting Rules Manager” window.

完成后,单击地址字段右侧的向下箭头以返回到完整的“条件格式设置规则管理器”窗口。

Note that the “Applies to” field now contains a range of cells instead of just a single address. Click the “Apply” button again, and you should see the whole table formatted according to your rule. In our example, you can see that the whole rows that contain movies made before 1980 are filled with green.

请注意,“适用于”字段现在包含一个单元格区域,而不只是一个地址。 再次单击“应用”按钮,您应该会看到根据您的规则格式化的整个表格。 在我们的示例中,您可以看到包含1980年之前制作的电影的整行都充满了绿色。

That’s it! If you have more complex needs, you can create additional formulas. And, of course, you can make your formulas a whole lot more complex than the simple example we’ve used here. You can even use conditional formatting between different spreadsheets, so that cells or rows in one spreadsheet are formatted differently depending on the data in a whole different sheet. Play around with the techniques we’ve covered, and in no time you’ll be creating intricate spreadsheets with data that pops right off the screen.

而已! 如果您有更复杂的需求,则可以创建其他公式。 而且,当然,您可以使您的公式比我们在此使用的简单示例复杂得多。 您甚至可以在不同电子表格之间使用条件格式,以便一个电子表格中的单元格或行根据整个不同工作表中的数据而采用不同的格式。 体验我们介绍的技术,您将立即创建复杂的电子表格,其中的数据会立即弹出屏幕。

翻译自: https://www.howtogeek.com/howto/45670/how-to-highlight-a-row-in-excel-using-conditional-formatting/

如何使用条件格式在Excel中突出显示行相关推荐

  1. 如何使用条件格式在 Excel 中隔行加底纹

    http://support.microsoft.com/kb/268568 要对工作表中的行隔行应用底纹,请按照下列步骤操作: 1. 启动 Excel,然后打开新工作表. 2. 在单元格 A1:D4 ...

  2. excel条件格式使用_如何使用条件格式在Excel中创建进度栏

    excel条件格式使用 Progress bars are pretty much ubiquitous these days; we've even seen them on some water ...

  3. excel日期相减去除周末_在Excel中突出显示周末日期

    excel日期相减去除周末 Yes, the weekend is over, but another one is just five days away! To make it easier to ...

  4. excel行列突出显示_在Excel中突出显示即将到来的日期

    excel行列突出显示 Do you use Excel to keep track of upcoming payments, or other dates? To make that list m ...

  5. 如何在Excel中突出显示不同颜色的重复值?(转载)

    转载连接:如何在Excel中突出显示不同颜色的重复值? 简介在Excel中,我们可以用一种颜色轻松地突出显示一列中的重复值 条件格式但是,有时候,我们需要突出显示不同颜色的重复值,以便快速轻松地识别重 ...

  6. 怎样让表格的行高一样_excel表格多数据如何设置行高-Excel EXCEL中如何把行高平均成一样高...

    excel表格如何设置行高 1.本次操作的软件为Excel电格,软件版本为office和学生版2016. 2.首先打开Excel电子表格,根据问题描述,我们格中输入用于演示设置表格最合适的行高列宽的数 ...

  7. 钢琴键盘excel_如何通过键盘在Excel中插入新行?

    钢琴键盘excel If you are a keyboard ninja, then you hate having to move your hands from the keyboard for ...

  8. java excel 删除行_使用Apache POI在Excel中删除多行

    我有一张包含75行表格的Excel表格 . 在第76行我有各列的总功能 =SUM(A1:A75) 和 =SUM(B1:B75) 在第77到第92位的行我有一个Excel图表这需要A1:A75和B1:为 ...

  9. 【工具与环境】Excel中批量插入行

    Excel中批量插入行 一.插入一行 二.插入多行 三.插入列同理 一.插入一行 在使用EXCEL时一定会遇到这样的问题--那就是插入行,右键→插入 二.插入多行 如何插入多行呢?有人也许会说&quo ...

  10. ubuntu下KDvelop中怎么显示行号

    ubuntu下KDvelop中怎么显示行号: 亲测好使:为节省时间只做资源的搬运工 https://blog.csdn.net/weixin_42927959/article/category/792 ...

最新文章

  1. RStudio配置R程序包的默认下载源
  2. python使用heapq快速查找最大或最小的 N 个元素
  3. 自然语言处理NLP基本知识小结
  4. SSL方式获取邮箱收件箱
  5. Linux入门!Linux无法联网解决办法!CentOS7、VMPlayer、VMWareWorkstation16资源!VMWareWorkstation16序列号!VMware安装Centos7!
  6. JTAG error:can not read register while CPU is running该如何解决
  7. CentOS 7 源码编译安装 Redis
  8. Redpine的Lite-Fi解决方案获Wi-Fi CERTIFIED认证
  9. 拉普拉斯分布_中心极限定理:从高尔顿板到麦克斯韦分布
  10. 长春工业大学计算机科学与技术录取分数,2021年长春工业大学各省各专业最低投档录取分数线统计(文科 理科)...
  11. JNI开发笔记(四)--实现一个简单的JNI工程并生成so库
  12. svn回退到上一个版本_Git实用教程(一) | 为什么需要版本控制?(以嵌入式项目开发为例)...
  13. java getselectedrow_Java Swing实现展示数据,以及过滤排序
  14. mysql 5.6.19 linux_MySQL 5.6.19升级到 5.7.9 步骤记录
  15. react-native gradle
  16. 小学计算机京剧脸谱教案,京剧脸谱小学高年级美术教学设计
  17. php 导出文件另行指定路径,生成excel文件到指定目录的函数php类库
  18. linux 卸载jdk和安装
  19. C#开发ActiveX控件
  20. java 前后端分离教程,Java web前后端分离

热门文章

  1. 针对TCP连接的网络监控平台—AINA Lyzer
  2. 如何用python做计算_如何用Python做些基本的数学运算
  3. javascript 一些常用的验证
  4. 苹果Mac电脑文件夹路径怎么看?“访达”也能显示文件路径
  5. 软件工程专业就业方向职业规划
  6. 10年攒一百万回老家一个月6千利息,现实么
  7. align-item 与 align-content 的区别
  8. 网站常用JSON嵌套形式
  9. 计算机应用后期影音制作,WindowsLive影音制作分步说明.docx
  10. 任务栏优化工具TrueLaunchBar_我是亲民_新浪博客