+ Reply to Thread
Results 1 to 11 of 11

Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

Hybrid View

  1. #1
    Registered User
    Join Date
    07-28-2017
    Location
    Basingstoke, England
    MS-Off Ver
    Office 2010
    Posts
    5

    Red face Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    Hi,

    I am trying to produce a traffic light (conditional formatting) RAG using a date and then applying a Frequency to determine the overall status of the RAG whilst applying the following rules:

    RAG Status = Column D (apply =TODAY()) which I apply to each cell within column D within the table.

    Conditional Formatting Rules:

    If the Date = Column C is greater than the Frequency = Column B = RED
    If the Date = Column C is 1 month less than the Frequency = Column B = AMBER
    All other instances = GREEN

    Traffic Light.PNG

    I hope that makes sense
    Regards Darrell

  2. #2
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    Welcome to the forum!

    I'm not sure I fully understand what you're aiming for. It would have been very helpful if you could have provided a sample workbook; they tend to be far more useful than images. Nevertheless, my interpretation of your request is that you're looking for a conditional formatting setup that returns an amber icon if the date is within the forthcoming month, a red icon if it has passed, and a green icon if it is more than a month in the future. You mention 'frequency', but my understanding is that the frequency helps determine what the date in column C(?) is, so the icon is based solely on the date in C and today, and not directly on the listed frequency. If I'm close, then you can use the following formula in the RAG column (D2 in my attachment):

    =IF(EDATE(C2,-1)>TODAY(),3,IF(C2>=TODAY(),2,1))

    This formula will return a 3 if it should be green, a 2 if it should be amber, and a 1 for red. Apply the CF accordingly. Take a look at the attachment to see if I've got it right. If I don't, please clarify what you're looking for and attach a sample workbook using: Go Advanced --> Manage Attachments to get to the upload window.
    Attached Files Attached Files
    If your problem has been solved, please use "Thread Tools" to mark the thread as "Solved".

    If you're grateful for this site's existence and would like to contribute to the community, please consider posting something hilarious in our joke thread:
    https://www.excelforum.com/the-water...ke-thread.html

  3. #3
    Registered User
    Join Date
    07-28-2017
    Location
    Basingstoke, England
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    Hello,

    Thanks for your help and assistance.

    For some reason I do not appear to be able to upload a workbook, although I could download your workbook.

    I am a bit of a novice at Excel so excuse me if I am not explaining things correctly.

    Your conditional formatting does not take into account the frequency by months which could be 3, 6, 9 or 12 months for example and hence a date (today's date) must check the frequency to determine it's RAG status as the frequency will determine when something is required for review or non-compliant.

    Icons.PNG

    An example I used previously was:

    Red =EDATE($C$4,$B$4+3)
    Amber=EDATE($C$4,$B$4+1)

    Difference in this instance is the RAG is Red = +3 months and Amber = +1 month from today's date.

    I hope this helps.

  4. #4
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    Where I'm lost is that I don't understand how your columns relate to one another, which is where a sample workbook would be helpful. Where do the dates in column C come from? Are they manually entered, or are they in some way based on an earlier date combined with column B (as was my interpretation).

    My understanding aside, though, I think the easiest approach to using the stoplight is to avoid using formulas in the RAG settings. Put a formula in the cells in column D that will return a 3 when you want green, a 2 when you want yellow, and a 1 when you want red, then just set the RAG rules to those values and check the box to show only the RAG result in the cell.

    If you're still stuck and can't post a sample workbook, please walk through a specific example to show how your expected result comes from the specific information available so that I/we can better understand how your "frequency" contributes, e.g. "If TODAY() is within 12 months (B2) of 23/8/2017 (C2), then return an amber light in D2"


    EDIT: Maybe it would help to show some examples and expected results in which the frequency isn't always 12?
    Last edited by CAntosh; 08-01-2017 at 01:21 PM.

  5. #5
    Registered User
    Join Date
    07-28-2017
    Location
    Basingstoke, England
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    Hi,

    Ok let me explain.

    The date field Column C is a manually applied date, this date determines the RAG status based upon the frequency (Column B).

    The Frequency (Column B) determines the frequency of when the documentation, test etc Column A needs to be reported upon by the RAG status.

    Some data is 3 months, some 6 months, 9 months etc, hence why the RAG has to take in the frequency.

    Example attached that looks at a RAG that is

    +1 Month of column C = Amber
    +3 months of column C = Red

    Does this help?
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    There's some hurdle in my brain that is simply not being cleared. The sample uses one "green" example that's right next to today and would be green under nearly any interpretation of your objective, while the "red" examples are so old that they would be red under any interpretation, so I can't really dissect how your 1 month/3 month rules fit with the frequency. Is the following interpretation correct?

    "If the DATE plus the FREQUENCY is within 1 MONTH of TODAY, then green."
    "If the DATE plus the FREQUENCY is within 3 MONTHS of TODAY, then amber."
    "Otherwise... red."

    or is it;

    "If TODAY plus the FREQUENCY is within 1 MONTH of the DATE, then green."
    "If TODAY plus the FREQUENCY is within 3 MONTHS of the DATE, then amber."
    "Otherwise... red."

    If those are both wrong, could you provide a similar set of clearly defined rules that includes the terms "Frequency", "Date", "today", and "1 month/3 month rule"?

  7. #7
    Registered User
    Join Date
    07-28-2017
    Location
    Basingstoke, England
    MS-Off Ver
    Office 2010
    Posts
    5

    Talking Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    Hi,

    I think I have solved the puzzle, after I reviewed your logic.

    Traffic Lights.PNG

    Can you check my logic to see if I have applied what I explained.

    Hopefully this will enable you to sleep better and less troubled by answering my query.
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    haha, I'm still not sure what logic I contributed, but if it somehow helped you find a solution, I'm content with that success. Based on what I see in your attachment, it looks like you're currently applying:

    - red light if today is past the date in C plus the months in B
    - amber light if today is within two months of the date in C plus the months in B
    - green light if today is not yet within two months of the date in C plus the months in B

    If that's what you're looking for, then it looks like you've got it!

    EDIT: Wait... no. What I've described above only applies to row 2. You have a different rule for every row? Let me re-evaluate...
    Last edited by CAntosh; 08-03-2017 at 10:28 AM.

  9. #9
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    Looking at your attachment further, I think your approach is problematic. Writing a different rule for each row is inefficient. As I mentioned above, I think it's wiser to write a formula for the cells themselves that returns a "3" for green, "2" for amber, and "1" for red. You can then use one formatting rule for the entire range. In the attachment, I use the following formula in E4, then fill it down:

    =IF(EDATE(C4,B4)>EDATE(TODAY(),1),3,IF(EDATE(C4,B4)>TODAY(),2,1))

    You can then apply the standard RAG rule to the entire E4:E9 range. This approach returns:

    - Green if the Date in C plus Months in B is more than one month away from today
    - Amber if the Date in C plus Months in B is coming within a month of today
    - Red if the Date in C plus Months in B has passed

    I'm hoping this interpretation is close to the mark?
    Attached Files Attached Files

  10. #10
    Registered User
    Join Date
    07-28-2017
    Location
    Basingstoke, England
    MS-Off Ver
    Office 2010
    Posts
    5

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    CAntosh, I would like to thank you for your help with my conditional formatting issues that you helped me resolve recently. Sorry the long delay in responding back to you life became a little bit hectic. Appreciate your support and perseverance in trying to understand my requirements and find a solution that works.

  11. #11
    Forum Expert
    Join Date
    05-20-2015
    Location
    Chicago, Illinois
    MS-Off Ver
    2016
    Posts
    2,103

    Re: Conditional Formatting by Date and Applying a Frequency to provide a Traffic Light

    I'm glad I could help, good luck!

+ 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. Conditional Formatting using traffic light system.
    By nelly7 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-07-2016, 02:18 AM
  2. [SOLVED] Conditional formatting + traffic light
    By Kagesen in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-07-2016, 05:01 AM
  3. conditional formatting a due date with a traffic light system
    By rocket01 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-08-2015, 05:11 PM
  4. Conditional formatting traffic light formula
    By fumusic in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-14-2014, 09:09 AM
  5. Traffic Light Conditional Formatting
    By hzaz in forum Excel General
    Replies: 4
    Last Post: 05-01-2013, 02:10 PM
  6. Need help with traffic light conditional formatting icon set
    By jjospeh in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-21-2012, 03:33 PM
  7. Conditional Formatting - Traffic light dates
    By zx561 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-19-2012, 02:51 PM

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