View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Mike Mike is offline
external usenet poster
 
Posts: 3,101
Default Two Criteria COUNTIF

Thank you all. I had not thought of SUMPRODUCT.

"Mike H" wrote:

Or if department numbers are different lengths use these 2

=SUMPRODUCT((LEFT($A$2:$A$5,1)<"7")*(B2:B5<0))
=SUMPRODUCT((LEFT($A$2:$A$5,1)="7")*(B2:B5<0))

Mike


"Mike" wrote:

I am trying to count the number cells with a value greater than zero based
upon two conditions. In column A will be Department numbers. In Columns B
through M will be monthly salary amounts. The work sheet will look like this:


A B C D
Dept Jan Feb Mar
11450 1000 1000 0
25000 0 2500 2500
70000 0 1000 1000
76500 1000 1000 1000

Domestic 1 2 1
International 1 2 2

Department numbers that begin with a number other than a 7 are Domestic
Departments and Department numbers that begin with a 7 are International
Departments.

I am trying to use the COUNTIF for the Domestic line by saying count the
cell for the month if the cell value is greater than zero and if the
Department number does not begin with a 7. For the International line I would
want the monthly cell counted if the cell value is greater than zero and if
the Department number does begin with a 7.

The Department numbers that are listed are formulas that are pulling values
from another Sheet.

I have been trying to use a combination of COUNTIF and MID with no luck. Any
help would be appreciated.