+ Reply to Thread
Results 1 to 3 of 3

Help to add an extra condition in IF formula

  1. #1
    Registered User
    Join Date
    03-16-2012
    Location
    PERTH
    MS-Off Ver
    Excel 2007
    Posts
    39

    Help to add an extra condition in IF formula

    Hi everyone

    I have a formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    which works perfectly to highlight if a job was attended to in Standby time however I have added a column which shows cancelled job as "Yes" "No" I now want my formula to look at
    If S3 (Cancelled column) = YES then the overall formula will return "No" in the standby column

    I tried
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    which works other than on the first two conditions. i am afraid i cannot upload a sheet at present as I'm at work.

    Any suggestions

    Thanks

    Kelly

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Help to add an extra condition in IF formula

    hi kelly. there's quite a number of problems here:
    1) i suppose S3 supersedes whatever that is in O3 or P3? that means if S3 is "Yes", it's "No" in the standby column no matter what O3:P3 are. to do that, the logic must be on the left. the IF formula works from left to right

    2) "6" with double quotes is a text. if you add +0, it becomes a number. so you can put in 6 or 7 straight away without the double quotes

    3) seems like O3 can be 6 or 7. you have used OR inside your formula, so i suppose you know that.

    4) "07:00" is a text. it's not a timing. to make it into a timing, you have to do the +0

    5) and it seems that N3 lesser than 7 am or greater or equals to 4 pm can also make it "Yes". this can be combined with the OR statement of O3.

    use this first to check with your 1st formula that works:
    =IF(O3="","",IF(OR(O3=6,O3=7,N3<"07:00"+0,N3>="16:00"+0),"Yes","No"))

    then slot in the S3 in somewhere that takes priority. i'm just guessing here:
    =IF(S3="yes","no",IF(O3="","",IF(OR(O3=6,O3=7,N3<"07:00"+0,N3>="16:00"+0),"Yes","No")))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    03-16-2012
    Location
    PERTH
    MS-Off Ver
    Excel 2007
    Posts
    39

    Re: Help to add an extra condition in IF formula

    Hi Benishyro

    Thanks for the help.

    If I remove the +0 and quote marks from my 6/7 the formula returns the wrong answer, the column is formatted as a number
    also if I add +0 to the time 07:00 which is formatted as a time my formula returns incorrectly

    I have amended the formula by adding
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    This seems to work perfect. If you have a moment can you explain the difference between using the +0 and why in my formula it does not work.

    Thanks
    Last edited by arlu1201; 10-15-2013 at 09:25 AM. Reason: Corrected formula tags.

+ 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. extra hours adding money for each extra hour worked FORMULA
    By cynthiamcastro in forum Excel General
    Replies: 3
    Last Post: 06-18-2012, 11:27 AM
  2. Formula: Finding todays date minus min value from certain range + extra condition
    By rain4u in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-04-2011, 10:21 AM
  3. Inserting extra row based on condition
    By nobleprince in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2010, 08:40 PM
  4. Adding an extra condition to an IF statement
    By Gooford in forum Excel General
    Replies: 6
    Last Post: 11-18-2009, 07:49 AM
  5. Modify a Function to add an extra condition
    By King_Quake in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2008, 04:32 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