COUNTIF Function

  • Thread starter Thread starter Duane
  • Start date Start date
D

Duane

Hello,

I am new to Excel and wondering if I could get some assistance on the
COUNTIF function or other more appropriate funtion.

I am exporting data from an Access database to an Spreadsheet. What I would
like to do is count the rows in the spreadsheet. The trick is that one of
the fields has 5 different assessment types of data that can be entered.

Adult
Adult Refusal
Re-Entry
Re-Entry Refusal
Other Facility

There may be 200 rows of data but each row will have one of the five
assessment types. I want to count all the rows except the Adult Refusal and
Re-Entry Refusal.

I tried to use the COUNTIF fucntion and it works fine for one criteria, but
I can't seem to figure out how to add a second criteria. Is it possible to
use multiple criteria or should I try to use a different function.

I could just create another recordset in my database to count the rows based
on my criteria and then populate the designated cell with the results. If
it is possible, I would like for Excel to do the counting so I don't have to
transfer so much data.

Thanks in advance.
 
Try this idea
=SUMPRODUCT(($B$2:$B$22={"adult","Adult Refusal","etc","etc","etc"})*1)
 
Another one:

=SUM(COUNTIF(A:A,{"Adult","Adult Refusal","Re-Entry",
"Re-Entry Refusal","Other Facility"}))
 
Hi,

You could also enter the items you want to count in a range, say F1:F3, and
then use the formula:

=SUMPRODUCT(COUNTIF(A1:A300,F1:F3))

and I believe the formula below, needs to be slightly modified to match your
request
=SUM(COUNTIF(A:A,{"Adult","Re-Entry","Other Facility"}))
 
Back
Top