+ Reply to Thread
Results 1 to 5 of 5

Formula Weekends

  1. #1
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Formula Weekends

    Hi Experts,
    I have a file I have created a project sheet, but I have an issue is a sheet, I don't want the formula to read weekends days which is highlighted in red cells, any exerpt can help me?

    attached image and excel file.

    Thanks in advance

    Aaru
    Attached Images Attached Images
    Attached Files Attached Files

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

    Re: Formula Weekends

    It would be better to apply the highlights in row 1 for the weekends using conditional formatting, so that it will automatically follow the date when you change cell D2. Give all those cells on row 1 from column F the same formatting of a pale blue background, and then select them all (i.e. F1:FQ1) and click on Conditional Formatting | New Rule | Use a formula... , and then put this formula in the dialogue box which pops up:

    =WEEKDAY(F1,2)>5

    Click on the Format button | Fill tab and choose Red, then OK twice to exit the dialogue box.

    The formula in F2 can be simplified to this:

    =IF(AND(F$1>=$D2,F$1<=$E2,WEEKDAY(F$1,2)<6),1,"")

    Copy this across and down as required.

    Hope this helps.

    Pete

  3. #3
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: Formula Weekends

    Thanks, Pete, also I want the chart with blue highlighted weekends should be in red, I think confusing to explain but if you see pic can understand.
    Attached Images Attached Images

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

    Re: Formula Weekends

    Read my first paragraph. It tells you how to apply conditional formatting to those cells in the range from F1 and across in order to show them as red if the date is for a weekend. As your start date in F1 is dependent on your first project start date in D2, you cannot have fixed formatting to turn them red, as your first project start date could be any day of the week.

    OR, do you mean those gaps between the horizontal blue bands should be red as well? If so, then you will need another CF rule with a formula which detects if the date is between the start and end dates for that project and it is a weekend. You keep changing your requirements (and colours) - your first picture does not show this.

    Hope this helps.

    Pete

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,587

    Re: Formula Weekends

    For blue color

    =AND(F$1>=$D2,F$1<=$E2,WEEKDAY(F$1,2)<6)

    For Red color

    =AND(F$1>=$D2,F$1<=$E2,WEEKDAY(F$1,2)>5)
    Attached Files Attached Files
    Pl note
    Array formula should be confirmed with Ctrl+Shift+Enter keys together.
    If answere is satisfactory press * to add reputation.

+ 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] Formula skip weekends
    By Oeysbrei in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-30-2019, 02:35 AM
  2. [SOLVED] Combine formula to exclude weekends and holidays with current IF formula
    By drewship in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-22-2016, 06:48 PM
  3. Exclude Weekends in formula
    By linganit in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 06-12-2016, 01:06 PM
  4. Skip Weekends ... but not normal weekends
    By MrMims82 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-03-2013, 03:59 AM
  5. Formula for excluding weekends
    By jgomez in forum Excel General
    Replies: 25
    Last Post: 12-23-2010, 04:47 PM
  6. Formula to exclude weekends
    By bton24 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-11-2006, 06:00 PM
  7. Remove weekends formula
    By shorty-1975 in forum Excel General
    Replies: 2
    Last Post: 04-07-2005, 09:47 AM

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