Solved

Multi tier IF with Countif problem

Posted on 2011-09-19
6
333 Views
Last Modified: 2012-05-12
I am working on an advancement template for Cub Scout Leaders similar to Trax but for a single scout that follows the scout through the entire program.  This is proving to challenge my Excel skills to their limits.  I am on the Bear Rank page and I have a few acheivements that say do requirement a and j + any 2 others.  During testing I found that the formulas that I setup are not really doing what they are suppose to.  Current formula for the example I gave is: =IF(AND(COUNTIF(I7:I14,"A")=2,I6="A",I15="A"),"C",IF(COUNTIF(I7:I14,"A")>=3,"C",IF(COUNTIF(I6:I15,"A")>0,"P"," ")))  I tried changing it to =IF(AND(COUNTIF(I7:I14,"A")=2,AND(I6="A"),AND(I15="A")),"C",IF(COUNTIF(I7:I14,"A")>=3,"C",IF(COUNTIF(I6:I15,"A")>0,"P"," "))) but it throws me an invalid formula error.  Not sure where I have gone wrong.  I will add your name to the credits if you share your info. Cub-History-1.xlsx
0
Comment
Question by:BMCISAdmin
6 Comments
 
LVL 15

Expert Comment

by:Haris Djulic
ID: 36560515
just replaced the commas with semi-comma and it gave me no error .. can you test if is it working ..

=IF(AND(COUNTIF(I7:I14;"A")=2;AND(I6="A");AND(I15="A"));"C";IF(COUNTIF(I7:I14;"A")>=3;"C";IF(COUNTIF(I6:I15;"A")>0;"P";" ")))
0
 
LVL 8

Expert Comment

by:ragnarok89
ID: 36560566
I think the problem is that your range "BearRank" is not made from a contiguous block of cells.

Wolfrank is  Wolf!$D$3:$D$15
It includes ALL cells from row 3 to 15. This is Good

BearRank is Bear!$C$9:$C$10,Bear!$C$12:$C$16,Bear!$C$18:$C$23,Bear!$C$25:$C$35
doeas NOT include all cells from row 9 to 35, this is bad.
0
 

Author Comment

by:BMCISAdmin
ID: 36560690
Still giving me invalid error.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 50

Expert Comment

by:barry houdini
ID: 36560715
Hello BMCISAdmin,

=IF(AND(COUNTIF(I7:I14,"A")=2,I6="A",I15="A"),"C",IF(COUNTIF(I7:I14,"A")>=3,"C",IF(COUNTIF(I6:I15,"A")>0,"P"," ")))

That looks better than your second attempt - you don't need to use multiple ANDS.....

Can you explain what you want the formula to do in words? Can you describe a pattern of values in I6:I15 where you don't get the result you want using the formula above?Don't forget that with nested IFs the later IFs are only evaluated when the other tests fail, e.g. you'll only get a "P" if that specific condition is satisfied (at least one "A" in I6:I15) but the previous two are not.

regards, barry


0
 

Author Comment

by:BMCISAdmin
ID: 36560779
barryhoudini For this particular achievement the scout has to complete requirement a nd j, I6 and I15, and any 2 other requirements, I7:I14.  The problem is that on the side of the bear page where this formula is I have a mini-dashboard that gives a status for each achievement and where the scout is in earning his rank.  Right now with the current formula if you put an A on requirement a throug d it marks the achievement with a C rather than keeping it a P since requirement J has not been marked with an A.
0
 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36560850
In your formula if the second IF...

IF(COUNTIF(I7:I14,"A")>=3

....is true if there are 3 "A"s or more in I7:I14, that doesn't care about I6 and I15. If the stipulation is that you need I6 and I15 to be "A"s and at least 2 others then remove that 2nd IF and use just

=IF(AND(COUNTIF(I7:I14,"A")>=2,I6="A",I15="A"),"C",IF(COUNTIF(I6:I15,"A")>0,"P",""))

regards, barry




0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now