Microsoft Excel: Conditional Formatting of Dates (Within Certain Ranges)

喜夏-厌秋 提交于 2019-12-11 12:37:13

问题


Trying to do conditional formatting in excel and it seems a little tricky for my data.

I have 654 dates. 654 rows/entries.

I need to use three colors:

Green - Make the cells green that are within 10 MONTHS OF TODAY'S DATE

Yellow - Make the cells yellow that are within 10 TO 12 MONTHS OF TODAY'S DATE

RED - Make the cells red that more than 12 MONTHS away from today's date OR do not have any data in the cell

I know this isn't correct but I feel like I'm on the right track:

red=($G$428:$G$655<=TODAY() + 365) how would I accommodate blank cells in this formula?

yellow=($G$3:$G$427<=TODAY() + 300 to 365) How would you correctly specify 'between 10 and 12 months'?

green=($G$3:$G$427<=TODAY() + 300)

Any input is appreciated.


回答1:


My test range was B3:B35 (selected before applying the rules)

=ABS(B3-TODAY())<=300 ' <10 months

=OR(B3="",ABS(B3-TODAY())>365)  'more than 1 year or empty

=ABS((B3-TODAY())>300) ' >10 months (rule above takes care of >12 mo)


来源:https://stackoverflow.com/questions/14900446/microsoft-excel-conditional-formatting-of-dates-within-certain-ranges

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!