+ Reply to Thread
Results 1 to 8 of 8

Based on year, if intersection of month and day is Saturday or Sunday, format cell.

  1. #1
    Registered User
    Join Date
    04-09-2014
    Location
    Ga, USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    Calander.png

    I have a calander that needs to be set up per the above/attached format. The weekend days are shaded in blue. Anyone know of a way to get the weekend days to format to blue based on the year typed in cell A1?

    Basically, I need it to look at the year in A1, and if the intersect of the Month and Day fo that year falls on a Saturday or Sunday, I need it to format that cell.

    I want this to update when the year is changed in A1.

    Thanks,

    John
    Last edited by John Maier; 09-04-2014 at 03:01 PM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    Hello John,

    Let's assume that table is in A2:AF14 with the year in A1 (months in A3:A14, day numbers in B2:AF2)

    Try this to conditionally format all weekends blue

    Select the whole range of date cells, i.e. B3:AF14 and use this formula in conditional formatting

    =WEEKDAY(B$2&$A3&$A$1,2)>5

    choose blue format > OK

    [if you want to get the "non days" at the end of the month in black, (bearing in mind that February 29th at least is variable) you can use this formula in another condition - =ISERROR((B$2&$A3&$A$1)+0)]
    Last edited by daddylonglegs; 09-04-2014 at 03:10 PM.
    Audere est facere

  3. #3
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    Is this a calendar to allow data to be filled in on each date or is it just a presentation?
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  4. #4
    Registered User
    Join Date
    04-09-2014
    Location
    Ga, USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    THIS IS EXACTLY WHAT I NEEDED!!!

    Is there a way to clear the prior formatting and reapply the conditional formatting when the year in A1 is changed?

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    If you do it the way I suggested that should happen automatically - just change the year and the formatting will change

  6. #6
    Registered User
    Join Date
    04-09-2014
    Location
    Ga, USA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    I see what the problem was. I had to clear all the formatting that I had previously assigned.

    GREAT JOB! Works perfectly!

    Thank you!

  7. #7
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    Tested......works as daddylonglegs has stated.

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Based on year, if intersection of month and day is Saturday or Sunday, format cell.

    Don't do any manual clearing of the formatting in the calendar as it will mess up the Conditional Formatting.

+ 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. [SOLVED] Calculate US Government Fiscal Year Week with Sunday(Start) and Saturday (End)
    By CHRISTINA1234 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-23-2013, 06:13 AM
  2. Conditional Format based on Year & Month.
    By SpiritedAway in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-06-2013, 06:02 PM
  3. identifying saturday and sunday in a date
    By mdub72 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-15-2008, 04:23 PM
  4. Cell formula for month & day of 1st Sunday of year
    By mikeburg in forum Excel General
    Replies: 4
    Last Post: 01-04-2007, 09:22 PM
  5. [SOLVED] Is there a way to identify saturday and sunday automatically
    By Unicornlmb in forum Excel General
    Replies: 2
    Last Post: 01-05-2006, 01:40 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