+ Reply to Thread
Results 1 to 6 of 6

If/AND/OR help needed..

  1. #1
    Anthony Slater
    Guest

    If/AND/OR help needed..

    I'm having trouble with an IF,AND,OR formula...

    A4=08:00
    B4=20:00

    A10 is a time entry cell, such as 10:21
    A11 is a date entry cell, such as 20/03/2005
    A12 works out the day of the week according to A11 (=A11 formatted as "dddd")


    I need the following: -

    If the time entered in A10 is between A4 and B4 and the day of week is NOT
    Saturday or Sunday the the answer should be "PEAK". If it is Saturday or
    sunday, the answer should be "OFFPEAK" regardless of the time.

    10:21 on 20/03/05(sun) should be OFFPEAK
    10:21 on 21/03/05 (mon) should be PEAK
    20:05 on 21/03/05 (mon) should be OFFPEAK

    Hope I explained it well

    TIA


  2. #2
    Bob Phillips
    Guest

    Re: If/AND/OR help needed..

    =IF(OR(WEEKDAY(A11)=1,WEEKDAY(A11)=7,A10<A4,A10>B4),"OFFPEAK","PEAK")

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Anthony Slater" <[email protected]> wrote in message
    news:[email protected]...
    > I'm having trouble with an IF,AND,OR formula...
    >
    > A4=08:00
    > B4=20:00
    >
    > A10 is a time entry cell, such as 10:21
    > A11 is a date entry cell, such as 20/03/2005
    > A12 works out the day of the week according to A11 (=A11 formatted as

    "dddd")
    >
    >
    > I need the following: -
    >
    > If the time entered in A10 is between A4 and B4 and the day of week is NOT
    > Saturday or Sunday the the answer should be "PEAK". If it is Saturday or
    > sunday, the answer should be "OFFPEAK" regardless of the time.
    >
    > 10:21 on 20/03/05(sun) should be OFFPEAK
    > 10:21 on 21/03/05 (mon) should be PEAK
    > 20:05 on 21/03/05 (mon) should be OFFPEAK
    >
    > Hope I explained it well
    >
    > TIA
    >




  3. #3
    Anthony Slater
    Guest

    Re: If/AND/OR help needed..

    Thanks Bob, that worked a treat...

    ....have a decent day

    "Bob Phillips" wrote:

    > =IF(OR(WEEKDAY(A11)=1,WEEKDAY(A11)=7,A10<A4,A10>B4),"OFFPEAK","PEAK")
    >
    > --
    >
    > HTH
    >
    > RP
    > (remove nothere from the email address if mailing direct)
    >
    >
    > "Anthony Slater" <[email protected]> wrote in message
    > news:[email protected]...
    > > I'm having trouble with an IF,AND,OR formula...
    > >
    > > A4=08:00
    > > B4=20:00
    > >
    > > A10 is a time entry cell, such as 10:21
    > > A11 is a date entry cell, such as 20/03/2005
    > > A12 works out the day of the week according to A11 (=A11 formatted as

    > "dddd")
    > >
    > >
    > > I need the following: -
    > >
    > > If the time entered in A10 is between A4 and B4 and the day of week is NOT
    > > Saturday or Sunday the the answer should be "PEAK". If it is Saturday or
    > > sunday, the answer should be "OFFPEAK" regardless of the time.
    > >
    > > 10:21 on 20/03/05(sun) should be OFFPEAK
    > > 10:21 on 21/03/05 (mon) should be PEAK
    > > 20:05 on 21/03/05 (mon) should be OFFPEAK
    > >
    > > Hope I explained it well
    > >
    > > TIA
    > >

    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: If/AND/OR help needed..



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Anthony Slater" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Bob, that worked a treat...
    >
    > ...have a decent day
    >
    > "Bob Phillips" wrote:
    >
    > > =IF(OR(WEEKDAY(A11)=1,WEEKDAY(A11)=7,A10<A4,A10>B4),"OFFPEAK","PEAK")
    > >
    > > --
    > >
    > > HTH
    > >
    > > RP
    > > (remove nothere from the email address if mailing direct)
    > >
    > >
    > > "Anthony Slater" <[email protected]> wrote in

    message
    > > news:[email protected]...
    > > > I'm having trouble with an IF,AND,OR formula...
    > > >
    > > > A4=08:00
    > > > B4=20:00
    > > >
    > > > A10 is a time entry cell, such as 10:21
    > > > A11 is a date entry cell, such as 20/03/2005
    > > > A12 works out the day of the week according to A11 (=A11 formatted as

    > > "dddd")
    > > >
    > > >
    > > > I need the following: -
    > > >
    > > > If the time entered in A10 is between A4 and B4 and the day of week is

    NOT
    > > > Saturday or Sunday the the answer should be "PEAK". If it is Saturday

    or
    > > > sunday, the answer should be "OFFPEAK" regardless of the time.
    > > >
    > > > 10:21 on 20/03/05(sun) should be OFFPEAK
    > > > 10:21 on 21/03/05 (mon) should be PEAK
    > > > 20:05 on 21/03/05 (mon) should be OFFPEAK
    > > >
    > > > Hope I explained it well
    > > >
    > > > TIA
    > > >

    > >
    > >
    > >




  5. #5
    Bob Phillips
    Guest

    Re: If/AND/OR help needed..


    "Anthony Slater" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Bob, that worked a treat...
    >
    > ...have a decent day
    >


    Decent? I'm going to have a great day :-)



  6. #6
    Dana DeLouis
    Guest

    Re: If/AND/OR help needed..

    > OR(WEEKDAY(A11)=1,WEEKDAY(A11)=7,

    Another option might be:
    WEEKDAY(A1,2)<=5

    (by shifting Monday to the start of the week)
    --
    Dana DeLouis
    Win XP & Office 2003


    "Anthony Slater" <[email protected]> wrote in message
    news:[email protected]...
    > Thanks Bob, that worked a treat...
    >
    > ...have a decent day
    >
    > "Bob Phillips" wrote:
    >
    >> =IF(OR(WEEKDAY(A11)=1,WEEKDAY(A11)=7,A10<A4,A10>B4),"OFFPEAK","PEAK")
    >>
    >> --
    >>
    >> HTH
    >>
    >> RP
    >> (remove nothere from the email address if mailing direct)
    >>
    >>
    >> "Anthony Slater" <[email protected]> wrote in
    >> message
    >> news:[email protected]...
    >> > I'm having trouble with an IF,AND,OR formula...
    >> >
    >> > A4=08:00
    >> > B4=20:00
    >> >
    >> > A10 is a time entry cell, such as 10:21
    >> > A11 is a date entry cell, such as 20/03/2005
    >> > A12 works out the day of the week according to A11 (=A11 formatted as

    >> "dddd")
    >> >
    >> >
    >> > I need the following: -
    >> >
    >> > If the time entered in A10 is between A4 and B4 and the day of week is
    >> > NOT
    >> > Saturday or Sunday the the answer should be "PEAK". If it is Saturday
    >> > or
    >> > sunday, the answer should be "OFFPEAK" regardless of the time.
    >> >
    >> > 10:21 on 20/03/05(sun) should be OFFPEAK
    >> > 10:21 on 21/03/05 (mon) should be PEAK
    >> > 20:05 on 21/03/05 (mon) should be OFFPEAK
    >> >
    >> > Hope I explained it well
    >> >
    >> > TIA
    >> >

    >>
    >>
    >>





+ 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