简体   繁体   English

如何在Excel中获取条件格式背后的公式

[英]How to get Formula Behind Conditional Formatting in Excel

How can I get formula applied behind conditional Formatting for highlighting Cells? 如何在条件格式后面应用公式以突出显示单元格?

Conditional Formatting is applied based on text in each cell of Test Result column(third column). 条件格式是根据“测试结果”列(第三列)的每个单元格中的文本应用的。 列突出显示

Formulas List: 公式列表: 总共应用了5个公式

Purpose is to reuse (copy paste) the formula in other sheets. 目的是在其他工作表中重复使用(复制粘贴)公式。

The formula is shown in your first screenshot. 该公式显示在您的第一个屏幕截图中。 The dialog has the formula in the column "Rule applied (in order shown)". 该对话框在“应用规则(按显示顺序)”列中具有公式。 These rules use the out of the box settings to format cells based on their values, so the "formula" is not accessible for editing. 这些规则使用开箱即用设置来根据其值格式化单元格,因此“公式”不可用于编辑。

But the format can be copied to other cells very easily. 但是格式可以很容易地复制到其他单元格。

Here are the steps: 步骤如下:

  • Select the cell with the conditional format and copy it 选择条件格式的单元格并复制它
  • click the cell where you want to apply the same format 单击您要应用相同格式的单元格
  • use Paste Special > Format to paste just the format to the selected cell 使用选择性粘贴>格式仅将格式粘贴到所选单元格

Edit: If you don't use the built-in conditional formats but instead select "Use a formula to determine ...", you can construct the formulas manually. 编辑:如果您不使用内置条件格式,而是选择“使用公式来确定...”,则可以手动构造公式。 在此处输入图片说明

There is no automated way to convert the existing out-of-the-box rules to fomulas. 没有自动的方法可以将现有的现成规则转换为fomulas。 You will need to use your human understanding of the logic and appy this to formulas. 您将需要使用您对逻辑的理解,并将其应用于公式。 So, for example, if the selected cell is H3, you can us this formula 因此,例如,如果所选单元格为H3,则可以使用此公式

=H3="Fail"

and format the cell with red font and light red background. 并使用红色字体和浅红色背景格式化单元格。 Note that there are no $ signs in the reference to the cell H3. 注意在单元格H3的引用中没有$符号。 If you copy that format to another cell, it will apply to that other current cell. 如果将该格式复制到另一个单元格,它将应用于该其他当前单元格。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM