+ Reply to Thread
Results 1 to 11 of 11

How to change the colour of a cell based on today's date + a few business days?

  1. #1
    Registered User
    Join Date
    09-22-2017
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    How to change the colour of a cell based on today's date + a few business days?

    Hello,

    I am a relatively new user of excel and am not really good with complex functions and formulas. But I really want to learn.

    I am making me this Excel-based tracker which will help me speed-up my work a lot. It contains a lot of conditional formatting. Most of it, I somehow managed to do myself reading here and there and watching youtube videos. But there is one thing which I was not able to find anywhere (probably did not search in the right place, or was not able to understand what I was watching or reading). Here is what I’ve been struggling to do for weeks now:

    I have a cell which is formatted as a date and I want this cell, when populated with a date, to be able to change its colour to green, yellow or red depending on today’s date + some business days added to today’s date. Assume that the cell in question is AN3, this is more or less the rule which I want to create for each colour:

    For green: if the date in AN3 is less than (today’s date + 5 business days), then AN3 should be green
    For yellow: if the date in AN3 is equal to (today’s date + 5 business days), then AN3 should be yellow
    For red: if the date in AN3 is greater than (today’s date + 5 business days), then AN3 should be red.

    Can anyone help me?

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to change the colour of a cell based on today's date + a few business days?

    The firewall did not like something. Here is a picture..

    Formula.jpg

    EDIT
    @mehmetcik is correct
    amend everything above from 5 to 7
    Last edited by kev_; 09-22-2017 at 12:47 PM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to change the colour of a cell based on today's date + a few business days?

    I think you are over complicating this,


    I assume "Today" will always be a weekday ie Monday to Friday.

    So whatever day is "Today" then there will be a weekend before the 5th Working day. So you really need to add 7 days.

    Is that not so?

    So

    rule for Green is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    rule for Yellow is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    rule for Red is:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by mehmetcik; 09-22-2017 at 12:54 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    09-22-2017
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: How to change the colour of a cell based on today's date + a few business days?

    I registered in this forum just a few hours ago, I asked a question, and my question is answered. You guys are incredible !

  5. #5
    Registered User
    Join Date
    09-22-2017
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: How to change the colour of a cell based on today's date + a few business days?

    Hello guys,

    What if I wanted to modify the condition for two business days as follows:

    For green: if the date in AN3 is less than (today’s date + 2 business days), then AN3 should be green
    For yellow: if the date in AN3 is equal to (today’s date + 2 business days), then AN3 should be yellow
    For red: if the date in AN3 is greater than (today’s date + 2 business days), then AN3 should be red.

    @mehmetchik: Your assumption is correct. "today" will always be a weekday i.e. Monday to Friday.

    Many thanks in advance

  6. #6
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to change the colour of a cell based on today's date + a few business days?

    Replace TODAY()+7 with:
    =WORKDAY(TODAY(),2)
    Above takes account of Saturdays and Sundays but ignores public holidays.

    To include holidays, enter holidays in a range (here = A1:A10) and the formula becomes
    =WORKDAY(TODAY(2),2,A1:A10)
    Last edited by kev_; 09-23-2017 at 05:35 AM.

  7. #7
    Registered User
    Join Date
    09-22-2017
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: How to change the colour of a cell based on today's date + a few business days?

    And what if I wanted to format AN3 as follows:

    1.PNG

    How can I do that? My problem is the part in the brackets... AN3 is always a business day (Mon thru Fri). But then I have no idea what function I should use for the '2 business days' part... I tried something like:

    2.PNG

    It did not work

  8. #8
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to change the colour of a cell based on today's date + a few business days?

    Example

    Yellow Was:
    =$AN$3=TODAY()+7

    Amend to:
    =$AN$3=WORKDAY(TODAY(),2)
    Last edited by kev_; 09-24-2017 at 06:03 AM.

  9. #9
    Registered User
    Join Date
    09-22-2017
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: How to change the colour of a cell based on today's date + a few business days?

    Hello guys,

    What if I have two cells e.g. AR3 and AS3.

    Again, I want to apply conditional formatting (this time to AS3) as follows:

    Green: if (the date in AS3) < (the date in AR3 + 10 business days)
    Yellow: if (the date in AS3) = (the date in AR3 + 10 business days)
    Red: if (the date in AS3) > (the date in AR3 + 10 business days)

    I guess it should be something close to:

    Green: AS3 < AR3+10
    Yellow: AS3 = AR3+10
    Red: AS3 > AR3+10

    …but how do I make Excel perceive the “10” part as business days?

  10. #10
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: How to change the colour of a cell based on today's date + a few business days?

    I am a relatively new user of excel and am not really good with complex functions and formulas. But I really want to learn.
    This request is an almost identical to what you asked before.
    Here is a way to help you understand how the WORKDAY formula works

    In 10 cells below each other
    - format the cels as dates
    - enter 10 formulas (as listed below)
    - look at what each cell returns
    - change the value in AR3

    =WORKDAY($AR$3,1)
    =WORKDAY($AR$3,2)
    =WORKDAY($AR$3,3)
    ...
    ...
    =WORKDAY($AR$3,10)
    Last edited by kev_; 10-04-2017 at 02:30 AM.

  11. #11
    Registered User
    Join Date
    09-22-2017
    Location
    Sofia, Bulgaria
    MS-Off Ver
    2013
    Posts
    10

    Re: How to change the colour of a cell based on today's date + a few business days?

    thank you very much Kev

    Now I understand.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Macro to change date as per business days and its format daily in a column
    By galbatrox9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2016, 09:26 PM
  2. VBA to filter from today's date + 4 business days
    By kop1ko in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-19-2016, 07:20 AM
  3. I need the color of the cell to change when within 30 days of today's date
    By splate in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-06-2013, 12:53 AM
  4. Date should not change based on cell 'c7' today function
    By mukeshbaviskar in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-14-2013, 03:10 AM
  5. Replies: 6
    Last Post: 08-23-2012, 12:14 PM
  6. Replies: 5
    Last Post: 12-02-2010, 10:35 AM
  7. How to change cell colour, X no days from inserted date in Excel?
    By Bayvon in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 10-14-2005, 01:05 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1