View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Miguel Zapico
 
Posts: n/a
Default Using nested IFs with CountIf

You can craft a table using array formulas. Following that example, if we
create the "com" table at E2, with the products in row E and the "must",
"maybe" and never in row 2, you can use this array formula in F3
=SUM(--($A$2:$A$7=$E3)*--($B$2:$B$7=F$2)*--($C$2:$C$7="com"))
As this is an array formula, you have to enter it with Ctrl+Shift+enter.
You can then copy it to the other fields of the table, and the references
will follow the axis.
You may need to change the ranges to fit your needs, or even better give
them a name and use it on the formula. For the Part table, just substitute
the final part of the formula, where "com" is hardcoded.

Hope this helps,
Miguel.

"Excel novice" wrote:

Can anyone help me I am trying to use the nested IF formula to add more than
one criteria prior to counting the number of

instance a value appears in a table.

A B C
2 milk must Com
3 bread maybe Part
4 cheese never None
5 milk maybe Com
6 curry must Part
7 bread must None

So, I am trying to find the number of instances milk appears in the table,
which are "must" and "com". Then I am trying to count the number of instances
milk appears with "maybe" and "com" etc. The result will produce an anaylysis
of the entries for all the types in column A. The variances contained in
column A is small approx 6 types, so will enter the criteria into the results
table like so:

The following table is for results which contain "Com"
Must Maybe Never
Milk 10 5 2
Bread 4 2 1
etc

The following table is for results which contain "Part"
Must Maybe Never
Milk 6 2 1
Bread 3 3 0
etc

I hope this is clear otherwise let me know, and thanks in anticipation.