+ Reply to Thread
Results 1 to 4 of 4

Need Help with Nested IF, OR, AND Statement > EXAMPLE Attached

  1. #1
    Registered User
    Join Date
    05-13-2015
    Location
    Lancaster, PA
    MS-Off Ver
    2013
    Posts
    3

    Need Help with Nested IF, OR, AND Statement > EXAMPLE Attached

    Hi everyone. I am trying to run multiple IF statements for a date selector and I am having some troubles. I feel like I am close but I believe my issue is how I am nesting everything.

    I currently have an IF AND statement giving the logic of (THE LOGIC BELOW IS SET FOR CELL F7):

    IF the Start Date (B7) is less than or equal to the date represented by cell (F5) AND the End Date (E7) is greater than or equal to the date represented by cell (F5) place a value of 1, if FALSE place a value of 0.

    I have that working just fine. Basically, using conditional formatting, the Start date and End date will be entered and each date block automatically fills in.

    A user can type in a Start Date and the amount of Hours needed to complete a project and the End Date will automatically updated. The End Date uses the WORKDAY function so Saturdays and Sundays are not counted
    So here is my problem, I still want to show Saturdays and Sundays in the week day name row (F6:CQ6) but what I would like to happen is that when column 7 is equal to Sat or Sun, display a “2”. I need that IF statement to be the highest priority because I would like to visually show weekends. Then, using more conditional formatting, each Saturday and Sunday will be a great block.

    These all need to be dynamically generated because I need to be able to have a random Timeline start date for each project. (The Timeline Start Date B1 controls the first date in cell F5)

    So here is what I have (representing the date for cell F7) so far…and yes, it isnt working.
    =IF(OR(F$7="sat",F$7="sun",”2”,IF(AND($B7<=F$5,$E7>=F$5),”1”,”0”)))

    I am sure I am missing something obvious or I am nesting incorrectly. Any help is great.

    Lastly, if the only way this can work is using VBA, can you please provide some detail? I am very, very new at VBA and I still am teaching myself how to use it.

    Thank you everyone for your help in advanced. Attached is an example of what I am trying to do.
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Need Help with Nested IF, OR, AND Statement > EXAMPLE Attached

    F7:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    copied across and down.


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-13-2015
    Location
    Lancaster, PA
    MS-Off Ver
    2013
    Posts
    3

    Re: Need Help with Nested IF, OR, AND Statement > EXAMPLE Attached

    TMS > That worked perfectly my friend.

    Thank you so much for your assistance!

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,434

    Re: Need Help with Nested IF, OR, AND Statement > EXAMPLE Attached

    You're welcome

+ 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. IF statement formula for multiple column data
    By adnanmir in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-09-2015, 10:14 AM
  2. [SOLVED] Need Excel Formula, IF THEN statement? (file attached)
    By WoooSaaaW in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-04-2013, 12:01 PM
  3. Replies: 5
    Last Post: 08-12-2011, 02:33 PM
  4. Replies: 6
    Last Post: 01-14-2009, 06:59 PM
  5. Question about attached if statement
    By Bill Stafford in forum Excel General
    Replies: 2
    Last Post: 09-23-2008, 03:04 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