Working with IF functions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
Try

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

for one-bedroom apartments

Regards,

Peo Sjoblom
 
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
 
For OR, use

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

--

HTH

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