+ Reply to Thread
Results 1 to 8 of 8

Conditional Formatting for Dates for multiple scenarios

  1. #1
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 365
    Posts
    164

    Conditional Formatting for Dates for multiple scenarios

    Attached is a sample spreadsheet in which I need to apply various Conditional Formatting rules in column E “Date Received."

    If there IS a date in the Initial Review Complete (G2), then the following calculation applies:
    Initial Review Complete (G2) – Date Received (E2) = Number of Days; if
    Number of Days >5 and <11 highlight cell in green
    Number of Days >11 highlight in orange

    If there is NOT a date in the “Initial Review Complete” (G2) cell then the following calculation applies:
    Today’s Date – Date Received (E2) = Number of Days; if
    Number of Days >5 and <11 highlight cell in yellow
    Number of Days >11 highlight in red

    All of the date calculations must consider weekend days and Holidays (see worksheet titled “HOLIDAYS”)

    Can I use the value created by a formula in column H, since that column is a formula and not a value?

    If there is a “N/A,” “Hold,” or a blank cell in column E, then no conditional formatting should apply.
    Attached Files Attached Files

  2. #2
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Formatting for Dates for multiple scenarios

    Quote Originally Posted by Hedy View Post
    Can I use the value created by a formula in column H, since that column is a formula and not a value?
    Yes you can.

    You have logic in place for < 11 and > 11 but what if the number of days = 11?

    Assuming it should be green (or yellow), try this:

    Highlight all of column E > Conditional Formatting > New Rule > Use a formula
    =AND(G1<>"",H1>5,H1<=11)
    Format: Fill Green > OK > OK

    Highlight all of column E > Conditional Formatting > New Rule > Use a formula
    =AND(G1<>"",H1>11)
    Format: Fill Orange > OK > OK

    Highlight all of column E > Conditional Formatting > New Rule > Use a formula
    =AND(G1="",H1>5,H1<=11)
    Format: Fill Yellow > OK > OK

    Highlight all of column E > Conditional Formatting > New Rule > Use a formula
    =AND(G1="",H1>11)
    Format: Fill Red > OK > OK
    Last edited by 63falcondude; 05-29-2018 at 11:42 AM.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Conditional Formatting for Dates for multiple scenarios

    I wont be answering this but for the benefit of others, here are some things to consider that you havent explained or are ambiguous.

    1) "if Number of Days >5 and <11 highlight cell in green
    INumber of Days >11 highlight in orange"

    So if <5 don't highlight ? You havent said this at all. Is this what you want to happen?

    2) By >5 do you mean 5>= ?
    By <11 do you mean <=11 ?
    By > 11 do you mean >11 or >=11 (see above line so you dont get conflicts regarding 11) ?

    For me (and all computers) > 11 means greater than 11, not greater than or equal to 11.
    So what do you mean by > 11 ?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  4. #4
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 365
    Posts
    164

    Re: Conditional Formatting for Dates for multiple scenarios

    Here is clarification - I should have used words rather than symbols and added the "equal to" for clarity - sorry!


    If there IS a date in the Initial Review Complete (G2), then the following calculation applies:
    Initial Review Complete (G2) – Date Received (E2) = Number of Days; if
    Number of Days greater than or equal to 5 and less than or equal to 11 highlight cell in green
    Number of Days greater than or equal to 12 highlight in orange

    If there is NOT a date in the “Initial Review Complete” (G2) cell then the following calculation applies:
    Today’s Date – Date Received (E2) = Number of Days; if
    Number of Days greater than or equal to 5 and less than or equal to 11 highlight cell in yellow
    Number of Days greater than or equal to 12 highlight in red

    That said, I am honestly looking to possibly tweak the number of days (5, 11, etc.), but wanted to get the formulas and logic.

  5. #5
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Formatting for Dates for multiple scenarios

    Have you tried the suggestion in post #2?

    Simply change >5 to >=5 to account for the change that you made in post #4.

  6. #6
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 365
    Posts
    164

    Re: Conditional Formatting for Dates for multiple scenarios

    I have made some tweaks below to your original set based on the suggestion to add the "="

    When calculating the dates I need to factor into the subtraction for when there are dates in both columns E and G the weekends and the Holidays (see HOLIDAYS worksheet). I am not sure if this is the case.

    Also, when there is no date in column G, the I need to subtract the date in column E from the date "today."


    =AND(G1<>"",H1>=5,H1<=11)
    Fill Green

    =AND(G1<>"",H1>=12)
    Fill Orange

    =AND(G1="",H1>=5,H1<=11)
    Fill Yellow

    =AND(G1="",H1>=12)
    Fill Red

  7. #7
    Forum Expert 63falcondude's Avatar
    Join Date
    08-22-2016
    Location
    USA
    MS-Off Ver
    365
    Posts
    6,266

    Re: Conditional Formatting for Dates for multiple scenarios

    Quote Originally Posted by Hedy View Post
    When calculating the dates I need to factor into the subtraction for when there are dates in both columns E and G the weekends and the Holidays.
    That is what the formula in column H is doing. We can use the results of that formula in the Conditional Formatting.

    Also, when there is no date in column G, the I need to subtract the date in column E from the date "today."
    And put that number where, in column H?
    Are you saying that the formula in column H is not producing the desired results when there is no date in column G and there is a date in column E?

    There are no instances of this in the sample that you shared and you have not mentioned this criteria in any of your previous posts.

  8. #8
    Forum Contributor
    Join Date
    05-01-2013
    Location
    Richmond, VA
    MS-Off Ver
    Excel 365
    Posts
    164

    Re: Conditional Formatting for Dates for multiple scenarios

    Ok - thank you - yes, since we are using column H for the number of days, application of the weekdays and holidays works perfectly. We are applying conditional formatting only to column E.

    Also, the two formulas Yellow or Red are for when there is NO date in column G and the date in column E is subtracted from "Today." You are correct that I did not have a row or two with this example - it was only part of the verbiage and I apologize.

    I am attaching a new version of the spreadsheet (Sample v01) with two rows without dates in Cells G2 and G4 for this purpose together with some notes in column N.
    *Row 2 (cell E2) which should be yellow since the date is 5/23 and within the 5 to 11 days
    *Row 4 (cell E4) is correctly highlighted in red since 3/26/18 is greater than 12 days from today

    Both the red and yellow conditional formatting should be based on "today's date" since this highlighting will only apply when there is no date in Column G. Right now, the conditional formatting formula is for the Yellow and Red is looking at column H, but it should only reference column H if there IS a date in column G. If there is not a date in column G, then instead of looking at column H, the formula should look at today's date. And again, weekdays and holidays must be factored into this.

    Also, there should not be any conditional formatting in cells that are not yet populated. I think that some of the problem is that I have dragged down the formulas in other columns, so as people enter rows of data, some of the formulas will automatically do the calculations, but the conditional formatting is recognizing some of this as data.

    I realize that this is confusing, and I have had a time trying to understand the criteria from my colleague/ "customer." I hope this response helps to clarify.
    Attached Files Attached Files

+ 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. VBA conditional formatting for multiple dates
    By ExcelDude88 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-15-2017, 01:20 PM
  2. [SOLVED] Conditional formatting with multiple conditions and dates?
    By GMcDonald in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-07-2017, 01:09 AM
  3. Help Required: Conditional Formula with multiple AND/OR scenarios
    By tomg82 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-03-2015, 05:19 PM
  4. [SOLVED] Complex Conditional Formatting Based on Multiple Scenarios
    By PhantomCell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2015, 07:45 AM
  5. Conditional Formatting for Multiple IF Scenarios
    By bunkerdc in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-02-2013, 01:43 PM
  6. [SOLVED] Excel 2007 : Conditional Formatting with Icons Sets and 4 scenarios
    By atheisen in forum Excel General
    Replies: 7
    Last Post: 07-17-2012, 12:43 PM
  7. Conditional Formatting Formulas for Multiple Dates
    By smart_as in forum Excel General
    Replies: 4
    Last Post: 03-02-2011, 06:03 PM

Tags for this Thread

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