+ Reply to Thread
Results 1 to 8 of 8

Thread: Nested IF statement

  1. #1
    Registered User
    Join Date
    09-27-2004
    Posts
    53

    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.

    =IF(C5:E5>H5,"pass","fail")

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

    Re: Nested IF statement

    Try:

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

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    Location: Location
    MS-Off Ver
    Excel 2007
    Posts
    266

    Re: Nested IF statement

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


    ... Or what NBVC said... I like his better...
    I '<3' reputation. If I helped, click the scales. This will be helping an internal departmental competition with co-workers.

    Reputation can be granted through the Scales Icon (for classic layout), or the little Star on the bottom of the post next to the blogging function for the new forum layout.

    If you're not busy, and really feel down on life, read my excel blog which may or may not have contents.

  4. #4
    Registered User
    Join Date
    09-27-2004
    Posts
    53

    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
    Location: Location
    MS-Off Ver
    Excel 2007
    Posts
    266

    Re: Nested IF statement

    I'll leverage HBVS's equation:

    =IF(AND(COUNTIF(C5:E5,">"&H5)=3,COUNTIF(C5:E5,"<"&H6)=3),"pass","fail")
    I '<3' reputation. If I helped, click the scales. This will be helping an internal departmental competition with co-workers.

    Reputation can be granted through the Scales Icon (for classic layout), or the little Star on the bottom of the post next to the blogging function for the new forum layout.

    If you're not busy, and really feel down on life, read my excel blog which may or may not have contents.

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

    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.
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

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

    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
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

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

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

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  8. #8
    Valued Forum Contributor Miraun's Avatar
    Join Date
    04-03-2009
    Location
    Location: Location
    MS-Off Ver
    Excel 2007
    Posts
    266

    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
    I '<3' reputation. If I helped, click the scales. This will be helping an internal departmental competition with co-workers.

    Reputation can be granted through the Scales Icon (for classic layout), or the little Star on the bottom of the post next to the blogging function for the new forum layout.

    If you're not busy, and really feel down on life, read my excel blog which may or may not have contents.

+ 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.2.0