+ Reply to Thread
Results 1 to 8 of 8

Conditional Formatting weekends

  1. #1
    Forum Contributor
    Join Date
    08-01-2012
    Location
    rotterdam, holland
    MS-Off Ver
    Excel 2013
    Posts
    170

    Conditional Formatting weekends

    For row 23 cells are becoming black while its not a weekend. I made a conditional format for the weekends, and cells become black when its a weekend.
    But in row 23, for example AP23:AP24, it's black while its not supposed to be black. This is just for June, the other months look fine to me. Anyone who can help? Thanks a lot.

    20022013 - kopie.xlsx

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Conditional Formatting weekends

    You could try using the WEEKDAY function as part of your conditional formatting formula to determine the weekend days.

    e.g.
    =WEEKDAY(DATE($D$1,5,AM$5))
    Martin

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Conditional Formatting weekends

    c18 = 6 => so the conditional format is true (so the conditional format turns into black).
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

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

    Re: Conditional Formatting weekends

    Okay, several issues.
    Your date formulas in your calendars should be (for example in AK19)
    =DATE($D$1,6,DAY(AK$18))
    That might fix your problem right there. However, an easier Conditional formatting formula (for that month for example) would be
    =WEEKDAY(AK19,2)>5
    Did that help?
    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

  5. #5
    Valued Forum Contributor Melvinrobb's Avatar
    Join Date
    06-19-2012
    Location
    Manitoba, Canada
    MS-Off Ver
    Excel 2013
    Posts
    1,128

    Re: Conditional Formatting weekends

    When the conditional format drags down the range the conditional format was looking at was dragging down as well. You would need to add $ to your cell references so they don't move down (ex. change c18 to C$18).

    This formula would probably work better for you though anyway, rather than a long OR function:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Please click the * icon below if I have helped.

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,724

    Re: Conditional Formatting weekends

    Another way of testing for weekends is a formula like this:

    =WEEKDAY(cell,2)>5

    where cell contains the date.

    Hope this helps.

    Pete

  7. #7
    Forum Contributor
    Join Date
    08-01-2012
    Location
    rotterdam, holland
    MS-Off Ver
    Excel 2013
    Posts
    170

    Re: Conditional Formatting weekends

    Lovely, that worked:

    =WEEKDAY(AK19,2)>5

    Thanks all

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Conditional Formatting weekends

    Ikzouhetnietweten,

    I'm afraid your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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