+ Reply to Thread
Results 1 to 5 of 5

debugging for formula with many IFs and ORs...

  1. #1
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    debugging for formula with many IFs and ORs...

    Hi,

    I have following conditions for a formula:

    This survey analyizes 2 questions and deduces a recognition score which is calculated as following
    If E8 is "-" or "do not remember", do nothing

    else, if E6 is either GOLD or PLTN
    then count range E8:E9 for "YES" and if counted amount is more than "1", return value "2"
    if counted amount is less than "1", return "0"

    Else, if E6 is "CLUB"
    then check if E8 is equal to "Yes" then return 1
    if cell E8 equal to "No" return return "0"

    My formula is this:
    Please Login or Register  to view this content.
    now the problem is that if the cell value in E6 is "CLUB" and "E8" is "Yes", the formula return "False" which actually should be returned as "1".

    I believe that I am missing an IF definition somewhere but just cant figure it out... any help would be much appreciated.

    Thanks,
    A2k
    Recognition2.xlsx

  2. #2
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: debugging for formula with many IFs and ORs...

    Try in E10 and copy across.

    =IF(AND(E6="Club",E8="yes"),1,IF(E8="No",0,IF(OR(E8="-",E8="Do not remember"),"",IF(OR(E6="PLTN",E6="GOLD"),IF(COUNTIF(E8:E9,"Yes")>=1,2),IF(C6="CLUB",COUNTIF(E8,"Yes"),0)))))
    Regards

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: debugging for formula with many IFs and ORs...

    hi A2k, your formula seems messy & i dont quite understand. but just to solve your problem, you mention if E6 is "Club" but put in C6:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Edit: if i understood correctly, then maybe even:
    =IF(OR(E8="-",E8="Do not remember"),"",IF(AND(OR(E6="PLTN",E6="GOLD"),COUNTIF(E8:E9,"Yes")),2,IF(AND(E6="CLUB",E8="Yes"),1,0)))
    Last edited by benishiryo; 01-28-2013 at 10:18 AM. Reason: additional info

    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

  4. #4
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: debugging for formula with many IFs and ORs...

    slightly shorter:

    Please Login or Register  to view this content.
    1100
    Last edited by icestationzbra; 01-28-2013 at 11:36 AM.
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  5. #5
    Forum Contributor
    Join Date
    03-24-2009
    Location
    Vietnam
    MS-Off Ver
    Excel 2010
    Posts
    382

    Re: debugging for formula with many IFs and ORs...

    Hey guys, thanks for the help.

    I tried all formulas and so far and I can only confirm that Benishiryo's edited formula and Fotis1991 contribution are doing the trick
    Please Login or Register  to view this content.
    as for icestationzbra, I do like your short and compact formula alot, but it doesnt work if E6 is PLTN and the counted YES in E8:E9 are only 1. I adjusted corrected the formula to
    Please Login or Register  to view this content.
    and it works now.

    Thanks alot for all the suggestions guys, much appreciate it!
    A2k

+ 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