+ Reply to Thread
Results 1 to 5 of 5

change background color if weekend (saturday and sunday)

  1. #1
    Registered User
    Join Date
    09-25-2009
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    51

    change background color if weekend (saturday and sunday)

    Hello,

    I have the following situation:

    2 excel workbooks
    - One contains something like a calendar (31 rows B1 to B31): the cells are formated like "dddd" giving the name of the day for each day in the month.

    - The other workbook contains a sheet with 31 cells in line (C15 to AG15) formated as "d" that get information from the first workbook

    Example for C15 formula:
    =[calendar.xls]Sheet2!$B$1
    where B1 from calendar shows the name of the day for 01.10.2009.. and so on for all days in a month.

    How can I change the background color of the rows 15 to 67 for if the cells or row 15 are the weekend days (in the second workbook)? The values shown on row 15 are dates from the calendar workbook formated as "d" so it only shows numbers.

    I tried using conditional formating with values:
    cell value is eqal to =Text($C$15, "dd.mm.yyyy")
    but I get formula error. I also tried several other formulas like ="Sun" but nothing happens. Either I don't know how to use conditional formating or the concept I try to use is wrong.

    Also even if I managed (which I haven't) to color the cells on row 15 which corespond to weekends, how can I make it color all the cells in those columns on every row till 67?

    If my problem is not clear please let me know and I will try to be more precise.
    Last edited by alexandruc; 09-29-2009 at 10:04 AM.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,601

    Re: change background color if weekend (saturday and sunday)

    Try this:

    =WEEKDAY(F3;2)>5 and choose format

  3. #3
    Registered User
    Join Date
    09-25-2009
    Location
    Loughborough
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: change background color if weekend (saturday and sunday)

    Try "Weekday" function

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: change background color if weekend (saturday and sunday)

    Just extending zbor's post...

    Highlight the range C15:AG67 (select C15 first) and apply a Custom Format rule of:

    =WEEKDAY(C$15;2)>5
    set format

    This will apply the Format to the entire range simultaneously with each column looking to the appropriate value in row 15.

  5. #5
    Registered User
    Join Date
    09-25-2009
    Location
    Romania
    MS-Off Ver
    Excel 2003
    Posts
    51

    Re: change background color if weekend (saturday and sunday)

    Thank you so much everyone! It works great.

+ 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