条件格式在多行中的第一个非空白单元格 [英] Conditional format first non-blank cell in multiple rows

查看:438
本文介绍了条件格式在多行中的第一个非空白单元格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望这将阻止链接。



如果您想要更多的背景,请查看链接的问题,但需要从FIRST的条件格式多行(2,000+) (最左边)非空白单元格+后面的11列。不知道是否需要条件格式公式,但是我可以得到每行的开始单元格,可以得到结束单元格(见下文)。



行中第一个填充单元格的单元格地址(*数据从第2行开始,数值从C列开始,并列在P列中):

  {=(ADDRESS(2,COLUMN(INDEX(C2:P2,MATCH(1,IF(C2:P2<大于0,IF(C2:P2<> 中,1)) ,0)))))}} 

^这让我一个绝对的文本版本的最左边的人单元格在每行。我有所有这些地址在帮助列。然后我可以获得格式的所需停靠点(从上述公式返回的单元格右侧的第12个单元格),但是我必须手动输入从以上公式导出的单元格地址:

  = ADDRESS(2,COLUMN(OFFSET(N2,0,11,1,1)))
/ pre>

我无法将启动单元格公式嵌套在此第二个公式中,否则会中断。



谢谢



期望的结果(忽略不同的颜色,可以相同):



解决方案

p>我添加了一个帮助列C,它在行中找到第一个非空白(我的数据从列D到列AZ)

  = MATCH(TRUE,INDEX((D2:AZ2  -  0),0),0)



  ==和(COLUMN) ( D2)<($ C2 + 11 + COLUMN($ D2)),COLUMN(D2)> = $ C2 + COLUMN($ C2))

您可以修改此选项,将帮助列放入所需的位置,并使用命名范围。



(必须添加条件在第一次之前不开始着色!)


Hopefully this will stop the chain.

See the linked questions if you want more background, but I need to conditional format multiple rows (2,000+) from the FIRST (leftmost) non-blank cell + the next 11 columns after it. Not sure if it's needed for the conditional format formula, but I am able to get the start cell for each row, can kind of get the end cell (see below).

Cell address of the first populated cell in the row (*the data starts on row 2, the values begin in column C and end in column P):

{=(ADDRESS(2,COLUMN(INDEX(C2:P2,MATCH(1,IF(C2:P2<>0,IF(C2:P2<>"",1)),0)))))}

^ this gets me an absoluted text-version of the leftmost populated cell in each row. I have all these addresses in a helper column. I am then able to get the desired stopping-point for the format (12th cell to the right of the cell returned from above formula), but I have to manually enter the cell address derived from above formula:

=ADDRESS(2,COLUMN(OFFSET(N2,0,11,1,1)))

I can't nest the start cell formula inside this second formula or it breaks.

THANK YOU!

Desired result (ignore the different colors, they can be the same):

解决方案

I added a helper column C that finds the first non blank in the row (my data went from column D to column AZ)

=MATCH(TRUE,INDEX((D2:AZ2<>0),0),0)

My conditional format rule applied to D2 to AZ4 was to highlight when the following was true:

==AND(COLUMN(D2)<($C2+11+COLUMN($D2)),COLUMN(D2)>=$C2+COLUMN($C2))

You can modify this to put the helper column where you wish, and to use named ranges.

(Had to add condition to not start coloring before the first instance!)

这篇关于条件格式在多行中的第一个非空白单元格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆