+ Reply to Thread
Results 1 to 8 of 8

Formula Problem with Multiple IF / AND Statements and Multiple outcome?

  1. #1
    Registered User
    Join Date
    04-22-2013
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Question Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    Hi there,

    This is my first post but I often seek help for excel queries so Im sure it won't be my last.

    I am trying to perform the following:

    ----
    If $D$5 = "SET" AND $E$5 = between 39.0 and 41.0 then display value entered and make $E$5 have Green background

    BUT

    if $D$5 = "CHECK" AND $E$5 = between 37.0 and 43.0 then display value and make $E$5 Green background


    If the value entered is outside of these tolerances OR "SET / CHECK" is not entered in $D$5 then make $E$5 have RED background
    ----

    For background info' my staff have to perform quality checks on the scales of a measuring device.

    If they enter "SET" then the tolerance of that scale is between 39.0 and 41.0. If it passes then the cell should turn Green. If it fails it should turn Red.

    If they enter "CHECK" then the tolerance of that scale is between 37.0 and 43.0. If it passes then that cell should turn green. If it fails it should turn Red.

    If they fail to write either "SET" or "Check" then it should either tell them, or for simplicity just turn red.


    I have tried contional formatting but couldn't get this to work with the "SET/CHECK" input.

    I also tried the following (this doesn't include changing cell colour) and it also didn't work:
    =IF($D$5="SET",IF($E$5<40.1,IF($E$5>38.9,IF($D$5="CHECK",IF(E5<43.1,IF(E5>36.9,E5))))))


    I have reached the limits of my Excel knowledge.
    Thanks in advance for your assistance.

    John.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    Try this:
    Please Login or Register  to view this content.
    Quang PT

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    Open file attached to see how the CF did
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    04-22-2013
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    Thanks Bebo,

    So Close - Your formula works great and I managed to use conditional formatting to turn the cell green if it passes.

    I now just need to turn the cell red if it fails. I tried to add conditional formatting and reversing the tolerances in your formula so it would turn red like so:
    Please Login or Register  to view this content.
    But doesn't seem to work.

    Thanks again for your help so far!
    Last edited by JONBOY666; 04-22-2013 at 01:13 PM.

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    Have you tried #3?
    Note that the defaul colour is green.
    The CF criteria is:
    =OR(AND($D$5="SET",$E$5<=39,$E$5>=41),AND($D$5="CHECK",$E$5<=37,$E$5>=43))
    Choose fill colour red
    should gives True, if matchs, then paint red to the cell

  6. #6
    Registered User
    Join Date
    04-22-2013
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    Just seen your book.

    Thankyou!

    Is it possible to have it apply to the cell where the value is inputted rather than a seperate cell? (Doesn't have to say fail, just keep the value entered)

    Thanks again!

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    You mean =E5, regardless of failure of not?
    Just type =E5 in destination cell (F5) to display the value in E5, and apply the CF criteria as mentioned above.

  8. #8
    Registered User
    Join Date
    04-22-2013
    Location
    Bury St Edmunds, England
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Formula Problem with Multiple IF / AND Statements and Multiple outcome?

    GOT IT!

    Had to have 4 rules:

    Kept the 2 rules above (CF)
    Then also had to add:
    Please Login or Register  to view this content.
    +
    Please Login or Register  to view this content.
    and select RED for formatting.

    Thanks so much! - I spent about 2 hours on this earlier.

    So glad I joined.

    Thanks again - John.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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