COUNTIF FUNCTION OR BETTER

tammyiam

New Member
Joined
Dec 2, 2005
Messages
2
Hello everyone!

I was told that this site is very helpful and was recommended to me. I have a brief question and hope someone could help me out or point me in the right direction.

I have a large spreadsheet where we have ages of people and whether or not they are a smoker. I need to figur out a way where I can count the number of people that are 18 to 30 and are smokers and the people who are 18 to 30 and are not smokers. Now our list has several thousand people, but I created a smaller sample so you can see what I am trying to do. Here is an image of it:

69389444_164cdf994c.jpg


I tried using the COUNTIF function and it limits myself to one criteria. I have tried use an AND statement within the criteria in the COUNTIF function and that doesn't work either. Could someone suggest something?

Help....

Tammy :p
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
Welcome to the board!

Sumproduct would work well for that. Try these:

Smoker
=SUMPRODUCT(--(B2:B14>=18),--(B2:B14<=30),--(C2:C14="yes"))

Non smoker
=SUMPRODUCT(--(B2:B14>=18),--(B2:B14<=30),--(C2:C14="no"))

HTH, T
 
Upvote 0

Forum statistics

Threads
1,216,380
Messages
6,130,291
Members
449,570
Latest member
TomMacca52

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top