Countif Formula

L

Lime

This has to be easy...
column "J" I need to count how many times "Alabama" shows in column "I" only
if column "H" = either "HOUSES" or "CONDOS" or "Apartments"

ANy help would be appreacited.
 
G

Glenn

Lime said:
This has to be easy...
column "J" I need to count how many times "Alabama" shows in column "I" only
if column "H" = either "HOUSES" or "CONDOS" or "Apartments"

ANy help would be appreacited.


=SUMPRODUCT(((H1:H10="HOUSES")+(H1:H10="CONDOS")+(H1:H10="Apartments"))*(I1:I10="Alabama"))
 
T

T. Valko

Try this...

Use cells to hold the criteria:

A1 = Alabama
B1 = Houses
B2 = Condos
B3 = Apartments

=SUMPRODUCT(--(I1:I5=A1),--(ISNUMBER(MATCH(H1:H5,B1:B3,0))))
 
E

Eduardo

Hi,

=if(or(H1:H1000="HOUSES",H1:H1000="CONDOS"),count(I1:I1000,"Alabama","")

if neither houses or condos are in column H the formula will display a blank
 
G

Glenn

Glenn said:
=SUMPRODUCT(((H1:H10="HOUSES")+(H1:H10="CONDOS")+(H1:H10="Apartments"))*(I1:I10="Alabama"))

Or this:

=SUMPRODUCT(((H1:H10={"HOUSES","CONDOS","Apartments"}))*(I1:I10="Alabama"))
 
G

Glenn

Couldn't get that to work...
Hi,

=if(or(H1:H1000="HOUSES",H1:H1000="CONDOS"),count(I1:I1000,"Alabama","")

if neither houses or condos are in column H the formula will display a blank
 
G

Glenn

T. Valko said:
Try this...

Use cells to hold the criteria:

A1 = Alabama
B1 = Houses
B2 = Condos
B3 = Apartments

=SUMPRODUCT(--(I1:I5=A1),--(ISNUMBER(MATCH(H1:H5,B1:B3,0))))


I like that. Is there a reason for your syntax over this?

=SUMPRODUCT((I1:I5=A1)*(ISNUMBER(MATCH(H1:H5,B1:B3,0))))
 
T

T. Valko

Is there a reason for your syntax over this?

It's slightly more efficient, especially on big ranges.
 
S

Shane Devenshire

Hi,

Here's another approache

=SUMPRODUCT((I1:I6=A1)*(H1:H6=B1:D1))

Where A1 contains Alabama, and B1:D1 your 3 types of housing.

direction is important.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top