Working with IF functions

J

JLyons

I am trying to ad onto an IF formula and I need help. I am using this formula
to count the number of apartments that are vacant. Some apartments have
illegal tenants (squatters). The formula below counts how many are "vacant"
or have "squatters", where squatters replaces vacant.

The formula is: =COUNTIF(C2:C56,"Vacant")

Now I need to count how many 1, 2, and 3 bedroom apartments are either
vacant or have squatters. The D column shows either a 1 for 1 bedroom
apartment, 2 for a 2 bedroom apartment, or 3 for a 3 bedroom apartment.

I tried =COUNTIF(C2:C56,"Vacant",D2:D56) but it did not.

What am I doing wrong.

Thanks for any help out there
 
P

Peo Sjoblom

Try

=SUMPRODUCT(--(C2:C56="Vacant"),--(D2:D56=1))

for one-bedroom apartments

Regards,

Peo Sjoblom
 
C

CLR

You might also want to take a look at the "Data > Filter > AutoFilter"...
function to study your data.........it will filter out to display only the
rows you're interested in............

Vaya con Dios,
Chuck, CABGx3
 
B

Bob Phillips

For OR, use

=SUMPRODUCT(--((C2:C56="Vacant")+(C2:C56="Squatters")),--(D2:D56=1))

--

HTH

RP
(remove nothere from the email address if mailing direct)
 

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