+ Reply to Thread
Results 1 to 7 of 7

Conditional Formatting and how to account for weekends?

  1. #1
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Conditional Formatting and how to account for weekends?

    Here are the formulas I am using, but I have gotten so far down the rabbit's bhole I can't figure out what is right/wrong. Please help me balance these out.

    RED = NOTHING RECEIVED, OUTSIDE 48 HOURS
    =AND(IF(WEEKDAY($D5,1)< 6,$D5+1< TODAY(),IF(WEEKDAY($D5,1)=6,$D5+3< TODAY(),$D5+2< TODAY())),ISBLANK($E5),NOT(ISBLANK($B5)),NOT(ISBLANK($D5)))

    ORANGE = SENT OUT, STILL WITHIN 48 HOURS
    =AND(NOT(ISBLANK($B5)),ISBLANK($E5))

    GREEN = RECEIVED WITHIN 48 HOURS
    =AND(IF(WEEKDAY($D5,1)< 6,$D5+1<= TODAY(),IF(WEEKDAY($D5,1)=6,$D5+3<= TODAY(),$D5+2<= TODAY())),NOT(ISBLANK($B5)))

    YELLOW = RECEIVED OUTSIDE 48 HOURS
    =AND(NOT(ISBLANK($B5)),$E5>$D5+2)
    Attached Files Attached Files
    Last edited by taylorsm; 04-08-2016 at 05:05 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting and how to account for weekends?

    Okay, first, deleting all your conditional formatting rules. Then selecting B5:AG268 > Conditional Formatting>New Rule>Use Formula

    Red
    =AND(ISBLANK(B5), B$4="Received", ISNUMBER(A5), NETWORKDAYS(A5, TODAY())>2)

    Orange
    =AND(ISBLANK(B5), B$4="Received", ISNUMBER(A5), NETWORKDAYS(A5,TODAY())<=2)

    Green
    =AND(ISNUMBER(A5), ISNUMBER(B5), B$4="Received", NETWORKDAYS(A5,B5)<=2)

    Yellow
    =AND(ISNUMBER(A5), ISNUMBER(B5), B$4="Received", NETWORKDAYS(A5,B5)>2)
    You can modify your NETWORKDAYS to include Holidays.
    Questions?
    Attached Files Attached Files
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Conditional Formatting and how to account for weekends?

    But it isn't only based on b5. B5 is only for that first group. F5, J5,N5, and so on is what the ISBLANK would refer to.

    A5 isn't a number, it is a blank cell. A column is blank

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting and how to account for weekends?

    The formula references the first cell in the range. Since the cell is not anchored (no $ in it), it is relative, moving with the active cell. If you check the file I attached, as far as I can tell, it is working properly. So when the active cell is E11, for example, D11 does have a number in it.

  5. #5
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Conditional Formatting and how to account for weekends?

    I'll plug it in and give it a shot!

    Is that the order I should have the rules in?

    I can include holidays? How so? Doesn't NETWORKDAYS do that?

    Thank you!
    Last edited by taylorsm; 04-08-2016 at 04:48 PM.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Conditional Formatting and how to account for weekends?

    The order of the rules won't matter because each cell will only meet one of the rules, never two.

    Yes, you'd have to add it to NETWORKDAYS

    Let's say you put your holidays in sheet2!A1:A15
    Red would become
    =AND(ISBLANK(B5), B$4="Received", ISNUMBER(A5), NETWORKDAYS(A5, TODAY(), sheet2!$A$1:$A$15)>2)

  7. #7
    Forum Contributor
    Join Date
    01-09-2016
    Location
    USA,USA
    MS-Off Ver
    2016
    Posts
    1,192

    Re: Conditional Formatting and how to account for weekends?

    Ah, OK. I may revisit that. Thank you man!

+ 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 for weekends
    By Lukael in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-05-2014, 10:50 AM
  2. Conditional formatting on dys (weekends) fields
    By lightofchaos in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-05-2014, 10:34 PM
  3. conditional formatting for weekends
    By Lukael in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 02-24-2014, 05:35 PM
  4. Conditional Formatting Around Weekends
    By robatbrightstar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-20-2013, 02:43 PM
  5. Conditional Formatting weekends
    By IKZOUHETNIETWETEN in forum Excel General
    Replies: 7
    Last Post: 02-22-2013, 01:58 AM
  6. Conditional Formatting - Skipping Weekends
    By RJodoin28 in forum Excel General
    Replies: 3
    Last Post: 01-16-2012, 04:28 AM
  7. Conditional formatting for weekends
    By monozoli in forum Excel General
    Replies: 2
    Last Post: 04-13-2008, 01:44 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