简体   繁体   English

条件格式(如果上方和下方的单元格是数字,则仅格式化下方的单元格)

[英]Conditional Formatting (If cell above and below is number, format only cell below)

I'am trying to create a conditional formatting which formats only cell below, but only if cell above and cell below both has number in them (negative or positive). 我正在尝试创建一个条件格式,该格式仅格式化下面的单元格,但是仅当上面的单元格和下面的单元格中都具有数字(负数或正数)时才格式化。

Now i got this: 现在我得到了:

=ISNUMBER(OFFSET(INDIRECT(ADDRESS(ROW(); COLUMN()));-1;0))

This formats the cell below if the cell above has a anything. 如果上方的单元格包含任何内容,则会格式化下方的单元格。 It does not respect the condition where the cell below also must have a number. 它不遵守以下单元格也必须具有数字的条件。

Could somebody help me out here? 有人可以帮我吗? I am realy stuck :) 我真的很困:)

EDIT: 编辑:

So now i tried this: 所以现在我尝试了这个:

=AND(ISNUMBER(INDIRECT(ADDRESS(ROW();COLUMN()))); ISNUMBER(OFFSET(INDIRECT(ADDRESS(ROW();COLUMN()));-1;0)))

But no luck whith this one either. 但也没有运气。

Just to clarify. 只是为了澄清。 This formula should run on $A$3:$BB$100 该公式应在$ A $ 3:$ BB $ 100上运行

So for example if: 因此,例如:

A5 = 10 (or any positive or negative number) A5 = 10(或任何正数或负数)

A6 = 10 (or any positive or negative number) A6 = 10(或任何正数或负数)

A6 should be formatet. A6应该是格式。

But if: 但是如果:

A5 = 10 (or any positive or negative number) A5 = 10(或任何正数或负数)

A6 = EMPTY A6 =空

No formating should happen. 不应进行格式化。

Hope this clarify what i'am trying to do :) 希望这可以澄清我正在尝试做的事情:)

=AND(ISNUMBER(A5),ISNUMBER(A6)) This formula will also bypass formatting for A6 as well if both cells are empty. = AND(ISNUMBER(A5),ISNUMBER(A6))如果两个单元格都为空,此公式也将绕过A6的格式设置。 I assume that's what you want, as there's no value within either to format. 我认为这就是您想要的,因为这两种格式都没有价值。

I see why we are getting different results with the formula. 我明白了为什么我们在公式中得到不同的结果。 Conditional formatting is applied relative to the active cell when applied. 条件格式设置是在应用时相对于活动单元格应用的。 Start with cell A2 as the first cell highlighted, (A2:A100),and then use this formula =AND(ISNUMBER(A2),ISNUMBER(A1)).Cell A2 should be the first active cell within the range of applied formatted cells. 以单元格A2作为第一个突出显示的单元格(A2:A100),然后使用此公式= AND(ISNUMBER(A2),ISNUMBER(A1))。单元格A2应该是已应用格式的单元格范围内的第一个活动单元格。

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

相关问题 Excel 2016 条件格式基于下面的单元格 - Excel 2016 conditional formatting based on cell below 基于上面的单元格的条件格式 - Conditional formatting based on cell above 当上方和下方的单元格不同时插入行 - Insert row when cell above and below are different 在最后一个单元格下方而不是上方插入一行 - Insert a row below the last cell and not above it Excel 条件格式 - 根据行号和公式格式化单元格 - Excel Conditional Formatting - format cell based on row number AND formula 如何在选定单元格下方添加空白行并保留上面的格式和公式 - How to add blank rows below selected cell and keep formatting and formulas of above 可以使用条件格式设置来更改内容,而不仅仅是单元格的格式吗? - Possible to use Conditional Formatting to change contents and not only the format of the cell? 在 Excel 中使用条件格式仅在满足 2 个条件时设置单元格格式 - Using Conditional Formatting in Excel to only format the cell if 2 conditions are met 将条件格式应用于范围,但仅对条件为真的单元格进行格式化 - Apply Conditional Formatting to Range but Only Format Cell Where Condition Is True Excel公式以上方的单元格填充下方的单元格,直到值更改 - Excel formula to fill cell below with cell above until value changes
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM