简体   繁体   English

Excel条件格式-突出显示之间的空白单元格

[英]Excel Conditional Formatting - Highlight blank cells between

thanks in advance for the help. 先谢谢您的帮助。

I'm making a Gantt chart in Excel and am trying to integrate the capability to highlight the work week (WW). 我正在用Excel制作甘特图,并试图集成该功能以突出显示工作周(WW)。 The idea is that one can select the WW from a drop down menu and the corresponding columns in the chart are highlighted. 这个想法是,可以从下拉菜单中选择WW,并突出显示图表中的相应列。 I am struggling with the conditional formatting formula to highlight the desired dates. 我正在努力使用条件格式公式来突出显示所需的日期。

Here's a screen shot of how the chart is set up 这是如何设置图表的屏幕截图

I am able to highlight the column of the cell containing the WW value (eg in picture column I is highlighted as it contains "WW42" in cell I3. I would like to be able to highlight the days from Sunday to Saturday of each WW. 我能够突出显示包含WW值的单元格的列(例如,在图片列I中被突出显示,因为它在I3单元格中包含“ WW42”。我希望能够突出显示每个WW从星期日到星期六的日子。

Most formulas (that I know) work on the value of the cells rather than their location or index. 大多数公式(我知道)都是基于单元格的值,而不是它们的位置或索引。 I have tried simply filling in all the blank cells with the WW value and then hiding the value, but the formatting isn't aesthetically pleasing and it's not efficient. 我试过简单地用WW值填充所有空白单元格,然后隐藏该值,但是格式化在美学上并不令人满意,而且效率不高。

I have also tried merging the WW cells, but am unable to select all columns of the length of the merged cell, just the first column associated. 我也尝试过合并WW单元格,但是无法选择合并单元格长度的所有列,仅选择关联的第一列。 For example, if I merged I3 to O3, conditional formatting will highlight that merged cell and only column I. 例如,如果我将I3合并到O3,则条件格式将突出显示该合并的单元格,仅突出显示列I。

Any suggestions on how to approach this is greatly appreciated! 任何有关如何解决此问题的建议将不胜感激!

我的结构的屏幕截图,显示了按要求工作的条件格式 Attached is a screenshot of my structure with my conditional formating working as required. 附件是我的结构的屏幕快照,其中条件格式化按要求工作。 You'll need to adjust acording to your structure, but I used a formula-based conditional formating, with the rule: 您需要根据自己的结构进行调整,但是我使用了基于公式的条件格式,其规则如下:

=COUNTA($B$2:B$2)=$A$1 //Where A1 contains the workweek I want to highlight

Entered into cells $B$3:$V$6. 输入单元格$ B $ 3:$ V $ 6。 Of course, in your case you'd have to change it to something like: 当然,在您的情况下,您必须将其更改为以下内容:

=COUNTA($B$2:B$2)+41-3=$A$1

Since your work weeks start at 42 and you have 3 extra headings you dont want added on your sum (ACTUAL START, ACTUAL DURATION and PERCENT COMPLETE). 由于您的工作周从42开始,因此您不想在总和上添加3个额外的标题(实际开始时间,实际持续时间和完成百分比)。 Also the header for the work week has to be a numeric value, but you can play around this to get what you need. 同样,工作周的标题也必须是数字值,但是您可以解决这个问题以获得所需的信息。 Let me know if you'd need further help. 让我知道您是否需要进一步的帮助。

You do not need to use the third row for your conditional formatting, if row 4 has legal excel dates. 如果第4行具有合法的excel日期,则无需使用第三行进行条件格式设置。 The WEEKNUM() formula gives you exactly what you need. WEEKNUM()公式可为您提供所需的确切信息。

If your Dropdown Menu is in cell B2 and consists of numbers from 1-52 then this should work for your conditional formatting: 如果您的下拉菜单位于单元格B2中,并且由1到52之间的数字组成,那么这对您的条件格式应该适用:

=$B$2=WEEKNUM(D$1)

See attached photo. 见附图。 在此处输入图片说明

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

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