[英]Google Sheets Conditional Formatting: if cell A is full, and this cell is empty
These should have been enough, but none of them have worked nor do any of their descriptions give an understanding of how they are supposed to work.这些应该已经足够了,但是它们都没有起作用,它们的任何描述也没有说明它们应该如何工作。
Google Sheets Conditional formatting custom formula: if current cell is empty, but other cell is not Google Sheets 条件格式自定义公式:如果当前单元格为空,但其他单元格不是
Google Spreadsheet conditional formatting based on empty cell with spaces 基于带空格的空单元格的 Google 电子表格条件格式
https://webapps.stackexchange.com/questions/85245/apply-conditional-formatting-if-other-cell-is-not-empty https://webapps.stackexchange.com/questions/85245/apply-conditional-formatting-if-other-cell-is-not-empty
https://support.google.com/docs/answer/3093290?hl=en https://support.google.com/docs/answer/3093290?hl=en
Here's the logic in code form:这是代码形式的逻辑:
const row = ["Some Name", "A value", null, null, "Another Value"];
function conditionMet(row: string[], column: index) {
return row[0] && !row[column]
}
Here's how I think it should be formatted:这是我认为应该格式化的方式:
=AND(NOT(ISBLANK(A)), ISBLANK(THIS))
Here's my best translation of the above based off the examples I've seen:这是我根据我看到的例子对上述内容的最佳翻译:
=AND(NOT(ISBLANK(A:1)), ISBLANK(A:1))
This isn't working.这不起作用。 I can't seem to find a "THIS" argument.
我似乎找不到“这个”论点。 I also don't understand why every example includes a row number.
我也不明白为什么每个例子都包含一个行号。 There's a fundamental gap in knowledge here that I'm sure is very obvious once you know it, but I haven't seen it specified yet.
这里有一个基本的知识差距,一旦你知道,我相信这是非常明显的,但我还没有看到它的具体说明。
Edit: example included编辑:包括示例
td { border: solid black; border-width: 1px 1px 0px 0px; } table { border-spacing: 0px; border: solid black; border-width: 0px 0px 1px 1px; } td[r] { background: red; }
<table> <tr> <td>A</td> <td>B</td> <td>C</td> <tr> <tr> <td>A</td> <td r></td> <td>C</td> <tr> <tr> <td>A</td> <td r></td> <td r></td> <tr> <tr> <td>A</td> <td>B</td> <td r></td> <tr> </table>
Assuming that you don't need to apply this conditional formatting on Column A, you can use the following formula to apply the conditional formatting for Range B:C假设您不需要在 A 列上应用此条件格式,则可以使用以下公式为范围 B:C 应用条件格式
=AND(NOT(ISBLANK($A1)), ISBLANK(B1))
There is no "THIS" keyword specifically for conditional formatting, but it depends on the range that you're applying the formula to.没有专门用于条件格式的“THIS”关键字,但这取决于您将公式应用到的范围。
If you apply the above formula for B1:C10
, then it will work like the "THIS" keyword because the 2nd ISBLANK(B1)
doesn't have a $
.If you apply it to any other range, it won't work the same.如果您将上述公式应用于
B1:C10
,那么它将像“THIS”关键字一样工作,因为第二个ISBLANK(B1)
没有$
。如果您将其应用于任何其他范围,它将不起作用相同的。
So, you can use the very first cell address of your conditional-formatting range to indicate the "THIS" keyword因此,您可以使用条件格式范围的第一个单元格地址来指示“THIS”关键字
And you can actually simplify the above formula like this:你实际上可以像这样简化上面的公式:
=AND($A1<>"",B1="")
You can see it in action in below screenshot:您可以在下面的屏幕截图中看到它的运行情况:
try on range X1:X:尝试范围 X1:X:
=NOT(ISBLANK($A1))*ISBLANK($X1)
where X is your column其中 X 是您的列
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.