ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Working with IF functions (https://www.excelbanter.com/excel-worksheet-functions/11281-working-if-functions.html)

JLyons

Working with IF functions
 
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

Peo Sjoblom

Try

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

for one-bedroom apartments

Regards,

Peo Sjoblom



"JLyons" wrote in message
...
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




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


"JLyons" wrote in message
...
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




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)


"Peo Sjoblom" wrote in message
...
Try

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

for one-bedroom apartments

Regards,

Peo Sjoblom



"JLyons" wrote in message
...
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







All times are GMT +1. The time now is 01:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com