简体   繁体   English

Google Sheets 条件格式:如果单元格 A 已满,并且此单元格为空

[英]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.这些应该已经足够了,但是它们都没有起作用,它们的任何描述也没有说明它们应该如何工作。

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.

相关问题 整行和整个单元格上的Google表格条件格式 - Google Sheets conditional formatting on whole row and cell 谷歌表格中的条件格式与相对单元格引用 - Conditional formatting in google sheets with relative cell referencing 在 Google 表格中使用条件格式来突出显示单元格 - Use Conditional Formatting in Google Sheets to highlight cell Google表格条件格式自定义公式:如果当前单元格为空,但其他单元格不为空 - Google Sheets Conditional formatting custom formula: if current cell is empty, but other cell is not 如果另一个工作表中的相同单元格不为空,Google 工作表条件格式会为单元格着色 - Google sheets conditional formatting to colour cell if the same cell in another sheet is not empty Google Sheets 脚本根据该单元格的值条件格式化单元格 - Google Sheets script conditional formatting a cell based on value of that cell 一个单元格中的 Google 表格条件格式文本会影响另一个单元格 - Google Sheets conditional formatting text in one cell effects another cell Google 表格 - 条件格式 - 基于另一个单元格文本的一个单元格 - Google Sheets - Conditional Formatting - One Cell Based on Another Cell Text Google表格中的条件格式可继承其他单元格的格式 - Conditional formatting in google sheets to inherit formatting from other cell Google表格:基于另一个单元格样式的条件格式 - Google Sheets: Conditional formatting based on another cell's style
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM