logo elektroda
logo elektroda
X
logo elektroda

Excel: Creating Formula to Alter Font/Cell Color Based on System Date Comparison

Helloween 38256 4
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 13291359
    Helloween
    Level 11  
    Hello
    I am asking for help from honorable users of "excelers"

    I have a cell (cell formatting is set to date) in which I enter the date of the next periodic health and safety test of the employee, e.g. 2016-02-11, how to write a formula that will change the font color of this date and / or fill the cell if the system date is a month earlier (until 2016-01-10 is to be normal formatting)?

    I tried conditional formatting but I can't do much with the date.
  • ADVERTISEMENT
  • Helpful post
    #2 13291443
    skorik
    Level 12  
    Hello,
    try this (in Excel 2007 or later):
    Select the cell with the date of the next test, click:
    conditional formatting -> rules for highlighting cells -> greater than ... -> in the window that opens, select the cell in which you have the current date and add "+31" (without quotes) or as many days as you need. So in this window you will have e.g. = $ C $ 3 + 31

    greetings
  • ADVERTISEMENT
  • Helpful post
    #3 13291479
    Maciej Gonet
    VBA, Excel specialist
    Good evening,
    Conditional formatting is the right direction. For example, you can use the formula for cell value less (or less than or equal to) than:
    Code: Text
    Log in, to see the code

    Regards
  • ADVERTISEMENT
  • Helpful post
    #4 13291484
    dt1
    Admin of Computers group
    Welcome,
    This can be easily done with conditional formatting - as shown in the picture.
    An example from Excel 2003, probably works the same in the newer ones.

    Excel: Creating Formula to Alter Font/Cell Color Based on System Date Comparison

    / edit: I see I was forewarned a bit :)
  • #5 13291554
    Helloween
    Level 11  
    Thank you very much for your help, everything works as it should now :)

    edit:
    I also checked (user example @-Maciej_ Gonet which I liked the most) in OpenOffice Calc (3.2) and it also works with the difference that after changing the system date - when testing - you have to close the file and reopen it to take conditional formatting into account.
    In Excel, each of the examples provided by you works without any problems without closing and re-opening the file :)
    Thank you again.
ADVERTISEMENT