简体   繁体   English

Excel 条件格式 - 两个条件

[英]Excel Conditional Formatting - Two conditions

I work for an accounting firm and I need a reminder to let us know when new credit card statements are available online every month.我在一家会计师事务所工作,我需要一个提醒,让我们知道每个月什么时候可以在线获得新的信用卡对帐单。 Here's what I need:这是我需要的:

If the cell immediately to the left is not empty AND the date in that cell is more than 30 days ago, change the color of the cell to green.如果紧靠左侧的单元格不为空并且该单元格中的日期是 30 天以前,请将单元格的颜色更改为绿色。

The formula below seems to work for the date portion but I'm not sure how to add the additional "if cell is not empty" condition.下面的公式似乎适用于日期部分,但我不确定如何添加额外的“如果单元格不为空”条件。

=TODAY()-(OFFSET(INDIRECT(ADDRESS(ROW(), COLUMN())),0,-1))>30 =今天()-(偏移(间接(地址(行(),列())),0,-1))> 30

screenshot截屏

Jeff.杰夫。

Try this way, changing the address to your needs:试试这种方式,根据您的需要更改地址:

=AND(K$6<>"",TODAY()-K$6>30)

I took your formula for the conditional apart, put it back together, and it doesn't work.我把你的条件公式拆开,把它放回原处,但它不起作用。 You do have a couple spaces in there, but fixing that didn't change matters.你确实有几个空间,但修复并没有改变问题。 So, I checked all pieces of the formula in Excel proper, they work.因此,我在 Excel 中正确检查了所有公式,它们有效。 Back to conditional, it doesn't.回到有条件的,它没有。 Used the formula similar to leal32b above, it worked beautifully.使用类似于上面的 leal32b 的公式,效果很好。

I went out to Google, and apparently Excel conditional formatting does not play well with indirect addresses.我去了谷歌,显然 Excel 条件格式不能很好地处理间接地址。 So you aren't crazy, but you probably aren't going to get it work.所以你并不疯狂,但你可能不会让它发挥作用。 Remember to remove $ signs as appropriate.请记住根据需要删除 $ 符号。

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

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