+ Reply to Thread
Results 1 to 7 of 7

Alternative to using multiple nested IF statements

Hybrid View

maacmaac Alternative to using multiple... 09-15-2011, 08:46 AM
NBVC Re: Alternative to using... 09-15-2011, 08:49 AM
maacmaac Re: Alternative to using... 09-15-2011, 09:36 AM
NBVC Re: Alternative to using... 09-15-2011, 10:07 AM
maacmaac Re: Alternative to using... 09-15-2011, 11:21 AM
NBVC Re: Alternative to using... 09-15-2011, 11:23 AM
maacmaac Re: Alternative to using... 09-15-2011, 12:51 PM
  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: Alternative to using multiple nested IF statements

    That works great. Just one more question. In other cases, there may be more than one possibility of key words for the grade. For example say the key words are "Fail" and "Pending". The formula also works for this scenario.

    =IF(OR(COUNTIF(A2:H2,"Fail"),COUNTIF(A2:H2,"Pending"))>0,"Review","Ok")

    My question is what if I had 15 words that I needed to key in on? Instead of having 15 different COUNTIF sections in the formula, is there a more effecient way to write the formula that what I have presented (i.e. could I create a list of key words and reference the list in the formula).

    Thanks again.

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

    Re: Alternative to using multiple nested IF statements

    So if all have to "Pass" to get an "Ok", then maybe this formula?

    =IF(COUNTIF(A2:H2,"Pass")=COUNTA(A2:H2)/2,"Ok","Review")
    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
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: Alternative to using multiple nested IF statements

    Much easier than the other way. I had to tweak your formula from:

    =IF(COUNTIF(A2:H2,"Pass")=COUNTA(A2:H2)/2,"Ok","Review")

    to:

    =IF(COUNTIF(A2:H2,"Pass")=COUNTA(A2:H2),"Ok","Review")

    Thanks again.

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

    Re: Alternative to using multiple nested IF statements

    Does that mean you removed the names adjacent to the grades?

    If not, then your new version won't work.

  5. #5
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,176

    Re: Alternative to using multiple nested IF statements

    You are correct. I was testing without take that variable into account. Thanks for pointing that out.

+ 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