Countif with multiple criteria

G

girasole

Hi. I am trying to compose a function in an Excel 2003 spreadsheet that will
count the number of cells that meet two criteria--to count if there is a date
in one column AND if there is specific text in another column.

Column I contains dates (appearing as, for example, 7-Feb-08, but stored as
2/7/2008)
Column E contains text

I have been trying to find a function that would do something along the
lines of:
Count if column I contains a date (and is not blank) AND if column E
contains "GC"

Any suggestions would be greatly appreciated!
 
P

Pete_UK

You can only use COUNTIF for one criteria. For more than one you can use
this:

=SUMPRODUCT((I1:I100>0)*(E1:E100="GC"))

Note that to Excel a date is just a number, and that a blank cell is
considered as being equivalent to zero in many formulae, so the first term
is checking for a number greater than zero in cells I1:I100. If you have
more rows than this then you have to change the range accordingly, but you
cannot use full-column references in versions before XL2007. If your dates
are fairly recent, then you could make the comparison >38000, as this is
equivalent to 14th January 2004.

Don't be put off by the name of the function - this will COUNT the cells
matching the criteria.

Hope this helps.

Pete
 
G

girasole

Thanks! I had tried using variations of the SUMPRODUCT function, but nothing
worked until your suggestion. Thanks again!
 

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