简体   繁体   English

基于单元格版本2的Excel动态条件格式

[英]Excel dynamic conditional formatting based on cell version 2

A few months back I posted the following question Conditional formatting rows based on cell dynamic . 几个月前,我发布了以下问题: 基于单元动态的条件格式行

At the time the formula provided was fantastic and still is however I'm redeveloping the spreadsheet and need something similar but I just can't figure out a solution. 当时提供的公式很棒,但仍然是我在重新开发电子表格,需要类似的东西,但我只是想不出解决方案。

I currently have a list of times in column A in increments of 1 hour from 9am to 9pm. 我目前在A列中有一个时间列表,从上午9点到晚上9点以1小时为增量。 In column BI would type 2 next to 9am it would somehow highlight 9am and 10am, now under that say you type 7 next to 11am it would highlight 11am, 12pm 1pm 2pm 3pm 4pm 5pm. 在BI列中,将在上午9点旁边键入2,它将以某种方式突出显示上午9点和上午10点,现在在您说的11上午旁边键入7,它将突出显示11 am、12pm 1pm 2pm 3pm 4pm 5pm。

Hope that makes sense 希望有道理

Many Thanks 非常感谢

This would seem to require the Use a formula to which cells to format option when creating a new CF rule. 在创建新的CF规则时,这似乎需要“ 使用公式来设置单元格格式”选项。

在此处输入图片说明

Select A2:B14 with A2 as the Active Cell and choose Home ► Styles ► Conditional Formatting ► New Rule. 选择带有A2的A2:B14作为活动单元格,然后选择“主页”►“样式”►“条件格式”►“新规则”。 Select the Use a formula to which cells to format option and supplt the following for Format values where this formula is true: 选择“ 使用公式设置单元格格式”选项,并在此公式为true的情况下为“ 格式”值提供以下内容

=AND($A2>=INDEX($A$2:$A$14,MATCH(1E+99,$B$2:$B2)),$A2<(TIME(VLOOKUP(1E+99,$B$2:$B2,1),0,0)+INDEX($A$2:$A$14,MATCH(1E+99,$B$2:$B2))))

Click Format and select some formatting. 单击格式,然后选择一些格式。 I chose an orange Fill . 我选择了橙色Fill Click OK to save the formatting choice(s) and then OK again to create the new rule. 单击“ 确定”保存格式选择,然后再次单击“确定”以创建新规则。 You should be left with something similar to the above sample image. 您应该得到与上述示例图像相似的东西。

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

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