View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
KL[_2_] KL[_2_] is offline
external usenet poster
 
Posts: 4
Default Combination of IF, AND, and COUNTIF; need help

Hi, I am trying to make a calculation that will take Pass/Fail values of P or
F and give me an overall value of P or F. There is also an issue if a value
is Not Tested, NT.

For example, I have three levels of requirements (parent, child, and
grandchild). Parent is level 1, Child is level 2, and Grandchild is level 3.

For each grandchild requirement multiple tests can be completed with a P, F,
or NT result. I have come up with a formula that will give me an overall
result of P or F:

=IF(COUNTIF(H8:H9,"F")0,"F","P") to say If any value in the range is
"F" the overall value is "F". This value would be put in cell H7.

This repeats for the next grandchild requirement that would be in say cells
H10:H12.

Now I can make the same formula for Not Tested as

=IF(COUNTIF(H8:H9,"NT")0,"NT","") to give me a blank overall result if
there are not tested values.

The problem I am having is how to combine the two formulas. I would like a
formula that says:

If there are any Fs give me an overall F.
If there are any NTs ignore them.
If ALL are Ps give me an overall of P.

I tried to do the following formula but it isn't working and I know I am
missing something I just can't figure out what it is:

=IF(AND(COUNTIF(H8:H10,"F")0,"F","P"),(COUNTIF(H8 :H10,"NT")0,"NT",""),"P","")

On top of all of that I also need the same type of formula to be in a cell
that can't use a range for the COUNTIF. They would need to be individual
cells.

For example,

Row 1's (parent) calculation needs to be based off of the overall pass/fail
status of rows 2 and 15.
Row 2's (child) calculations needs to be based off of the overall pass/fail
status of rows 3 and 7.
Row 3's (grandchild) calcuations are based off of the cell range.

I tried the following but it didn't work:

=IF(AND(COUNTIF(H3, H7, H10,"F")0,"F","P"),(COUNTIF(H3, H7,
H10,"NT")0,"NT",""),"P","")

I know this is a lot in one post but I thought it would be best to get
everything out there.

I would appreciate any and all help with this! Thank you!