简体   繁体   English

Excel条件格式:如果单元格不为空白,则将边框添加到行? 但是忽略公式吗?

[英]Excel Conditional Formatting: Add border to row if cell not blank? But ignore formula?

I have a spreadsheet with index match formulas running down column B like so: 我有一个电子表格的索引匹配公式沿B列运行,如下所示:

Column B        Column C        Column D        Column E
=IndexMatch
=IndexMatch
=IndexMatch
=IndexMatch

If my formula returns a result then it might look like this: 如果我的公式返回结果,则可能如下所示:

 Column B        Column C        Column D        Column E
 Value 1
 Value 2

What i want to do is add conditional formatting to the non blank rows and add a bottom border to range B to E for that row, so the rows with a returned value, 我想做的是向非空白行添加条件格式,并为该行在B到E的范围内添加底边框,因此具有返回值的行,

So the rows with value 1 and value 2 in would have a border but the other rows won't. 因此,值1和2的行将带有边框,而其他行则没有边框。

I'm trying to use this: 我正在尝试使用此:

=COUNTA($B14)>0

but this adds a border to all my rows with formulas in not just the one returning a result. 但这会给我所有带有公式的行添加边框,而不仅仅是返回结果的边框。

Please can someone show me where i am going wrong? 请有人能告诉我我要去哪里错吗?

  1. Select cells B2:E2 选择单元格B2:E2
  2. On the Home Ribbon, Click Conditional Formatting -> New Rule -> Use a formula to determine which cells to format 在主功能区上,单击条件格式->新规则->使用公式来确定要格式化的单元格
  3. In format values where this formula is true enter 此公式为真的格式值中,输入

    =NOT(ISBLANK(B2)) = NOT(ISBLANK(B2))

  4. Click Format button and do formating 单击格式化按钮并进行格式化

  5. Ok, apply 好,申请

在此处输入图片说明

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

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