How do I use nested countif statements?

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

Guest

I want to be able to count the values in a list that meet two different
criteria. There is one column of dates and then another column of model
numbers. I want to create a row of the number of model number per date. Any
help is appreciated
 
Hi Frank

Try Sumproduct
=SUMPRODUCT(($A$1:$A$100=DATE(2006,11,13))*($B$1:$B$100="Model"))
Change the date value and "Model" to suit.

You may be looking for lust the Year, as opposed to an individual date,
in which case I would do the following.

Place your "Model" in cells e.g. in cell D2:D10
and place your Dates in cells E1:H1 e.g 1/1/2000, 1/1/2001, 1/1/2002
then copy the following to E2 and copy down and across as appropriate
=SUMPRODUCT(($A$1:$A$100=E$1))*($B$1:$B$100=$D2))

Better still, create a Pivot Table.
For help on creating Pivot Tables take a look at the following sites
http://peltiertech.com/Excel/Pivots/pivotstart.htm
http://www.contextures.com/xlPivot02.html

http://www.datapigtechnologies.com/flashfiles/pivot1.html
 
use this if you are doing it in a cell

=SUMPRODUCT(--(a1:a50="big"),--(b1:b50="fat"),--(c1:c50="ugly"))

it will tell you how many records there are which meet the criteria for big
and fat and ugly.

otherwise you might look at pivot tables as a neat way of viewing your data.
Drag the date field into the columns, and the model number (count of model
number) into the data section.
very quick pivot table training is here:
http://www.datapigtechnologies.com/ExcelMain.htm
 
Frank I also have the same question...
This is the CountIF function I'm using but can't seem to get it to do what I
want.
In column B I'm counting the number of days between dates that are equal to
or greater than 365 days...that part works fine...but I also want to have the
countif only look at a specific persons name in column "W". Excel accepts
the format but does not return a correct answer...??

=COUNTIF(B$2:B$474,">=365""Sam Jones")
 
sorry I should have written
=sumproduct(--(B$2:B$474>=365),--(W$2:W$474="Sam Jones"))
 
Allllen, Your suggestion worked great!! Thank you very much
What are "--" ?? I have never used them.
Could not tell the difference between your first suggested fomula and the
second?
 
You're very welcome, Frank. Thanks for the feedback.

Did you take a look at Pivot Tables? You really should as they are a far
more effective way of quickly changing views of this type of data. Take
a little time to learn and understand them - that time will be well
rewarded.
 

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

Back
Top