如何在Excel中自动填写条件格式?

时间:2021-08-06 16:00:48

Column A has a number 1-10. Column B has a string I want to highlight with conditional formatting. How do I make it so that if the number in Column A is greater than 7, the cell in the same row in Column B will automatically turn blue?

A列是1-10。B列有一个字符串,我想用条件格式突出显示。如果A列中的数字大于7,那么B列中同一行的单元格会自动变为蓝色?

I use the conditional formatting tool for cell B1 such that, in the "Use a formula to determine which cells to format" option, I have ="IF($A1 > 7)", then fill the cell with blue.

我使用cell B1的条件格式工具,在“使用公式确定要格式化哪些单元格”选项中,我有=“IF($A1 > 7)”,然后用蓝色填充细胞。

But, as I drag/autofill down, the 1 in $A1 does not become A2, A3, A4, A5, A6, etc. as I want it to. What am I doing wrong?

但是,当我拖动/自动填充时,A1中的1不会变成A2、A3、A4、A5、A6等等。我做错了什么?

2 个解决方案

#1


5  

Change the formula to:

改变公式:

=$A1 > 7

And take a look at my yoursumbuddy post, which explains why you don't need IFs in Conditional Formatting:

看看我的yoursumbuddy文章,它解释了为什么在条件格式中不需要IFs:

#2


1  

Select B1, then column B (This should make all the cells bluish except the cell B1, which is said to be the 'active' cell).

选择B1,然后选择B列(这应该使所有的细胞都呈蓝色,除了细胞B1,也就是所谓的“活跃”细胞)。

Open up conditional formatting and use the formula:

打开条件格式并使用公式:

=IF($A1 > 7, 1)

You need to at least specify the value if true and there's no need to drag the conditional formatting down.

如果值为true,则至少需要指定该值,并且不需要将条件格式拖下来。

#1


5  

Change the formula to:

改变公式:

=$A1 > 7

And take a look at my yoursumbuddy post, which explains why you don't need IFs in Conditional Formatting:

看看我的yoursumbuddy文章,它解释了为什么在条件格式中不需要IFs:

#2


1  

Select B1, then column B (This should make all the cells bluish except the cell B1, which is said to be the 'active' cell).

选择B1,然后选择B列(这应该使所有的细胞都呈蓝色,除了细胞B1,也就是所谓的“活跃”细胞)。

Open up conditional formatting and use the formula:

打开条件格式并使用公式:

=IF($A1 > 7, 1)

You need to at least specify the value if true and there's no need to drag the conditional formatting down.

如果值为true,则至少需要指定该值,并且不需要将条件格式拖下来。