View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Help with counting two different criterias.

I think I may have misread your question. Did you want the count for COMP **or** "OUTST" **or** "ABOVE (that is what I gave you)? Or did you want it for each of those separately. If separately...

=SUMPRODUCT((A1:A1000=40)*(B1:B1000="COMP"))
=SUMPRODUCT((A1:A1000=40)*(B1:B1000="OUTST"))
=SUMPRODUCT((A1:A1000=40)*(B1:B1000="ABOVE"))

Change what the first logical expression is equal to (40 in the above example) to whatever other values you want. You may want to use a cell reference rather than a hard-coded number to make changing values easier... just replace the 40 with, say, C1 and put your number (40 for the above example) into C1.

--
Rick (MVP - Excel)


"Rick Rothstein" wrote in message ...
Try this formula...

=SUMPRODUCT((A1:A1000=40)*((B1:B1000="COMP")+(B1:B 1000="OUTST")+(B1:B1000="ABOVE")))

Each specified range must contain the same number of elements. I assumed your data started at A1, but you can change all the row references from 1 to whichever row your data starts in. I chose 1000 as the last possible row where your data could be... this number (in all the ranges) needs to be a row number that is larger than the maximum row your ever expect to put data in (it is alright if Columns A and B have no data in their cells for the range specified... the formula will ignore them... so it is alright to use a row number larger than the actual data you now have).

--
Rick (MVP - Excel)


"Jboo" wrote in message ...
Hello, I need help with a counting criteria I have in two different columns.
For example I need to know how many "40"'s from column A are Comp or OUTST or
Above and so on from Column B, then how many "83"s are COMP or OUTST or ABOVE
and so on. I have used the CountIf function but it will only do the first
criteria.
A B
43 COMP
83 COMP
83 COMP
40 COMP
43 COMP
40 COMP
40 OUTST
40 ABOVE
40 NEDVL
83 UNSAT