+ Reply to Thread
Results 1 to 8 of 8

Nested IF statement

  1. #1
    Forum Contributor
    Join Date
    09-27-2004
    Posts
    133

    Question Nested IF statement

    I have the following values in cells C5, D5 and E5:

    1.21, 1.15, 1.17

    I want to compare ALL of these to the value in cell H5 which is 1.06.

    If they are all greater than 1.06 then cell J5 shall indicate "Pass", otherwise, "Fail".

    I used the following with no success.

    Please Login or Register  to view this content.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested IF statement

    Try:

    =IF(COUNTIF(C5:E5,">"&H5)=3,"pass","fail")
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Nested IF statement

    =if(And(C5>H5,D5>H5,E5>H5),"Pass","Fail")


    ... Or what NBVC said... I like his better...
    Going for Guru! Click the Star to the bottom left of this post if I helped!

  4. #4
    Forum Contributor
    Join Date
    09-27-2004
    Posts
    133

    Re: Nested IF statement

    Thank you.

    What if I want to go a step further.

    I now want to compare those values to both cells H5=1.06 and cell H6=1.35. That is, I want "pass" if ALL of the values in C5 to E5 are between 1.06 and 1.31, and "fail' otherwise.

  5. #5
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Nested IF statement

    I'll leverage HBVS's equation:

    =IF(AND(COUNTIF(C5:E5,">"&H5)=3,COUNTIF(C5:E5,"<"&H6)=3),"pass","fail")

  6. #6
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested IF statement

    Try:

    =IF((COUNTIF(C5:E5,">="&H5)-COUNTIF(C5:E5,">"&H6))=3,"pass","fail")

    This includes the limits set in H5 and H6.

  7. #7
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Nested IF statement

    Quote Originally Posted by Miraun View Post
    I'll leverage HBVS's equation:
    Wow, I've never seen my handle spelled that badly off

  8. #8
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    New England
    MS-Off Ver
    2003, 2007, 2010, 2013
    Posts
    554

    Re: Nested IF statement

    Wow... that was pretty impressively bad... Sorry about that. I'll just copy/paste all usernames for a bit... and it was only 4 characters

+ 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