+ Reply to Thread
Results 1 to 26 of 26

Conditional Formatting Issue

  1. #1
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Conditional Formatting Issue

    I am having a conditional formatting problem. I have to format an Excel sheet to show eval completion dates with the following parameters: <30 green, 30-60 days yellow, over 60 days red, and it has to be from the date of the anniversary date but only by the month and day. Plus the Eval completed date has to be able to track not only the month and day, but year by the anniversary date. I can't get the formula right.


    Please Login or Register  to view this content.
    The appointment date does not play much factor and would only confuse the equation.

    Thank you.
    Last edited by 6StringJazzer; 03-13-2023 at 05:41 PM. Reason: code tags for data spacing

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    Your example is incorrect. 2/3 is more than 30 days after 12/5 so should be yellow. 6/13 is almost a year after 6/15 so should be red. I have attached a file with a solution and more complete data.

    There is one rule for red and one rule for green. I have defaulted the cell color to yellow so no color is needed for yellow; if it's not red or green, it will be yellow be default.
    Attached Files Attached Files
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    I tried this and it didn't work. I attached the worksheet to see if you have some luck.
    Attached Files Attached Files

  4. #4
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    Quote Originally Posted by KMBLUM72 View Post
    I tried this and it didn't work. I attached the worksheet to see if you have some luck.
    There is no conditional formatting in this file, so I don't know why it didn't work for you. It works for me. Column M is just for reference and can be deleted. Blank cells in column J will be yellow by default. Let me know if you want something different.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    Thank you so much for your help! I will just paste the other info into your worksheet, I don't know why it wouldn't work for me.....I appreciate you

  6. #6
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    I got to looking at this spreadsheet a little closer and it is not calculating correctly. There are dates from 2018, 2019, etc that are showing yellow and green that should be red. How can this be fixed?

  7. #7
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    Give me one or two specific examples so I can troubleshoot.

  8. #8
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    I attached the worksheet again. For example, line 3, 4, 6, and 11 should all be red because they are outside of the year timeframe. It calculates in some but not all.
    Attached Files Attached Files

  9. #9
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    Quote Originally Posted by KMBLUM72 View Post
    should all be red because they are outside of the year timeframe.
    What do you mean by the year timeframe? You originally said
    <30 green, 30-60 days yellow, over 60 days red
    Just looking at line 3

    H
    I
    J
    1
    Anniversary Date
    Appointment Date
    PDP Eval Completed Date
    3
    06/16/1997
    06/16/2022
    06/17/2020

    6/17 is only 1 day later than 6/16 so should be green. Please explain why this should be red. I'm not going look at other dates until your requirements are clear.

  10. #10
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    The 2020 date. It should be red because it is not within the last year of being done so it is overdue. It would have to have been done on 6/16/2022 to still be in compliance and be green. It's the year that is throwing it off.

  11. #11
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    Can you give a more rigorous explanation of your requirement? First you said only by month and day, now somehow the year comes into play.

  12. #12
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    So the spreadsheet is to track yearly evaluations. The month and day is when it is due, every year. If the evaluation is not done within 60 days of that day within that calendar year, it is past due. That is what I am trying to capture. When evaluations are coming due, past due, not done at all, or are in compliance. I really hope this helps explain.

  13. #13
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    "Plus the Eval completed date has to be able to track not only the month and day, but year by the anniversary date"

    That is what I was trying to say in the original post.

  14. #14
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    Let's take a look at row 4, which you said gives the incorrect color.

    H
    I
    J
    1
    Anniversary Date
    Appointment Date
    PDP Eval Completed Date
    4
    10/05/1998
    02/13/2023
    11/01/2022

    If the evaluation is not done within 60 days of that day within that calendar year
    Within what calendar year?

    In row 4, the Anniversary Date is 10/5/1998, and the PDP Eval Completed Date is in 2022, so the due date in that calendar year would be 10/5/2022. The completed date here is 11/1/2022, which is 27 days after the due date. Therefore it is less than 30 days and should be green.

    Please explain where I went wrong in this explanation.

  15. #15
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    This one is correct. It is the one's that are in 2020, 2019, 2018, etc that are not calculating correctly.

  16. #16
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    For example, line 3, 4, 6, and 11 should all be red
    Well, now I'm just lost. That example I just did was row 4.

    You still need to define your requirement regarding the year.

    OK let's look at row 6, which has a date in 2020.

    H
    I
    J
    1
    Anniversary Date
    Appointment Date
    PDP Eval Completed Date
    6
    04/17/2006
    05/04/2015
    06/01/2020

    In row 6, the Anniversary Date is 4/17/2006, and the PDP Eval Completed Date is in 2020 so the due date in that calendar year would be 4/17/2020. The completed date here is 6/1/2020, which is 45 days after the due date. Therefore it is 30-60 days after the due date and should be yellow.

    Please explain where I went wrong in this explanation.

  17. #17
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    I'm sorry I confused you on row 4, I got confused on the months.....this whole project is frustrating me.

    So row 6 should be red because it is in 2020. To be in compliance, the last eval would have to have been within 30 days of 4/17/2022.

  18. #18
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    OK. I have been trying to pull this out like a bad tooth but here is what I think your requirement is. Please comment:

    We are trying to determine the number of days elapsed since the Due Date for an evaluation. The Due Date for this purpose is the most recent date with the same month and day as the Anniversary Date. Examples:

    Anniversary Date
    Due Date
    6/19/1995
    6/19/2022
    6/16/1997
    6/16/2022
    10/5/1998
    10/5/2022
    2/3/1999
    2/3/2023
    4/17/2006
    4/17/2022
    4/30/2014
    4/30/2022
    10/18/2022
    10/18/2022
    3/18/2020
    3/18/2022
    7/2/2001
    7/2/2022
    10/2/2003
    10/2/2022
    4/8/2013
    4/8/2022
    5/22/2008
    5/22/2022
    10/21/2010
    10/21/2022
    10/21/2010
    10/21/2022
    3/8/2017
    3/8/2023
    8/23/2021
    8/23/2022
    7/18/2011
    7/18/2022

    You did not state that anywhere but I am trying to read between the lines.

    ALSO

    All of your dates are text. My formulas are still working with that but whenever you have dates in Excel you should use date values, not text.

  19. #19
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    I formatted the dates to be dates and not text, not sure how that happened and yes, what you have above is correct......you read between the lines

  20. #20
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    The cells are formatted to be dates, but the data that was put into them is text.

    Now that we have defined what is a "due date" please explain what is the elapsed time you want to measure to determine the color--what date minus what date? I don't understand the overall problem you are trying to solve.

    Here is the formula to determine the due date:

    Values as displayed
    H
    I
    J
    K
    L
    M
    1
    Anniversary Date
    Appointment Date
    PDP Eval Completed Date
    PDP Expectations Set Date
    Due Date
    2
    06/19/1995
    04/16/2022
    12/11/2020
    01/14/2020
    6/19/2022

    Underlying formulas
    H
    I
    J
    K
    L
    M
    1
    Anniversary Date
    Appointment Date
    PDP Eval Completed Date
    PDP Expectations Set Date
    Due Date
    2
    06/19/1995
    04/16/2022
    12/11/2020
    01/14/2020
    =IF(DATE(YEAR(TODAY()),MONTH(H2),DAY(H2))>TODAY(),DATE(YEAR(TODAY())-1,MONTH(H2),DAY(H2)),DATE(YEAR(TODAY()),MONTH(H2),DAY(H2)))

  21. #21
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    So, if a PDP is not done within 60 days of the due date of the calendar year, it is past due. I am trying to capture PDP's that are coming due and past due. I found out today the green is not necessary. So PDP's that are not done or up to the 60 days of the anniversary mm/dd should be red.

    Any evaluations that are done within the correct timeframes can just be left a normal color, red is the only color I need anymore. That just changed, I am so sorry.

  22. #22
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    if a PDP is not done within 60 days of the due date of the calendar year
    We're going in circles. What do you mean by "of the calendar year"?

    Most of your PDP dates are more than a year old so be definition they will be red.

  23. #23
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    I figured out what's been bugging me about this. It seems like this has to somehow take into account today's date.

    If this data were mine, here is what I would want to see:

    If there has been no PDP eval completed since the last due date, turn the date red if the due date was more than 60 days before today's date.

    See attached for that implementation and let me know if that helps.
    Attached Files Attached Files

  24. #24
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    I thought about it last night and to simplify it the best I can, anything that is past due should be red. The spreadsheet you sent is much, much better. I know it looks wanky but with the pandemic, no evals have been getting done so pretty much everyone is out of compliance.

  25. #25
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2411
    Posts
    26,673

    Re: Conditional Formatting Issue

    How do you define past due? What if the PDP Eval date was just a few days after the due date? It was late, but it's not longer due. What if it was a few days before the due date? That means it was done so shouldn't be due, but what do you consider the dividing line between being early for the latest due date (and therefore fulfilled the requirement) vs. being late for the prior one (therefore the current one is still due)?

    We have to get from the abstract concept of "I want anything past due to be red" to define in very concrete terms how we look at these dates and determine what is considered "past due." You can imagine why it is complicated to build big systems.

  26. #26
    Registered User
    Join Date
    03-13-2023
    Location
    US
    MS-Off Ver
    365
    Posts
    14

    Re: Conditional Formatting Issue

    Yes. I would say 30 days before and 30 days after the due date, but nothing more outside of that for a bit of wiggle room.

    My supervisor wants anything coming due within 90 days to show red and change once it is completed, I just don't see how that is possible.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Conditional Formatting issue
    By whahnelt in forum Excel General
    Replies: 2
    Last Post: 10-07-2019, 05:07 AM
  2. Conditional formatting issue
    By Stief1981 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-29-2019, 10:36 AM
  3. Conditional Formatting Issue
    By ANSAMOIZ in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-29-2017, 06:28 AM
  4. Conditional Formatting Issue
    By ehizzlefosho in forum Excel General
    Replies: 3
    Last Post: 05-12-2016, 11:32 AM
  5. Custom formatting issue using conditional formatting
    By wrongway15 in forum Excel General
    Replies: 2
    Last Post: 07-13-2014, 03:18 PM
  6. [SOLVED] Help with a conditional formatting issue
    By TigerEN1 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-21-2014, 07:41 AM
  7. [SOLVED] Conditional Formatting Issue
    By nikolasm in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 03-12-2013, 01:34 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