#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default Countif Array

I am having trouble using the countif function with an array. I have two
columns, one of which is the department column (with department names in each
cell) and the other column is question column (with YES and NO answers in
each cell). I want to count the number of YES and NOs for each department.

I tried to use this countif array function: {=countin(if((A2:A21="ADMIN"),
B2:B21, ""), "YES")}

Can you help me please? I keep getting the VALUE error.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Countif Array

Assume your departments are listed in column A and the yes/no answers
are in column B. List each of your departments in column D starting in
D2 and put "Yes" in E1 and "No" in F1, so that you will have something
like this:

D E F
Yes No
Admin
Personnel
Sales
etc

Then in E2 put this formula:

=SUMPRODUCT((A1:A1000=$D2)*(B1:B1000=E$1))

You can copy the formula into F2, then copy E2:F2 down until you have
covered your list of departments. You will have the count of Yes and
No under those columns for each department - is this what you want?

Hope this helps.

Pete

On Dec 5, 8:27 pm, Mike wrote:
I am having trouble using the countif function with an array. I have two
columns, one of which is the department column (with department names in each
cell) and the other column is question column (with YES and NO answers in
each cell). I want to count the number of YES and NOs for each department.

I tried to use this countif array function: {=countin(if((A2:A21="ADMIN"),
B2:B21, ""), "YES")}

Can you help me please? I keep getting the VALUE error.


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,101
Default Countif Array

Pete

My YES and NO answers are not in seperate columns, they are in the same
column. I used a list to select YES or NO in each cell.

Can you respond please?

"Pete_UK" wrote:

Assume your departments are listed in column A and the yes/no answers
are in column B. List each of your departments in column D starting in
D2 and put "Yes" in E1 and "No" in F1, so that you will have something
like this:

D E F
Yes No
Admin
Personnel
Sales
etc

Then in E2 put this formula:

=SUMPRODUCT((A1:A1000=$D2)*(B1:B1000=E$1))

You can copy the formula into F2, then copy E2:F2 down until you have
covered your list of departments. You will have the count of Yes and
No under those columns for each department - is this what you want?

Hope this helps.

Pete

On Dec 5, 8:27 pm, Mike wrote:
I am having trouble using the countif function with an array. I have two
columns, one of which is the department column (with department names in each
cell) and the other column is question column (with YES and NO answers in
each cell). I want to count the number of YES and NOs for each department.

I tried to use this countif array function: {=countin(if((A2:A21="ADMIN"),
B2:B21, ""), "YES")}

Can you help me please? I keep getting the VALUE error.



  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Countif Array

I wasn't sure if you wanted just one column of results, i.e. any answer for
each department, or if you wanted it like the table I gave you. At least
with the 3 column table it is easy to add the Yes and No columns together.

Actually, the formula needs a bit of amendment:

=SUMPRODUCT(($A1:$A1000=$D2)*($B1:$B1000=E$1))

Put this in E2, and when you copy it to F2 it will still be looking at
columns A and B, then copy these two cells down.

If you only want a single column against each department (i.e. no
distinction between yes and no), then put this formula in E2 and copy down:

=COUNTIF(A:A,D2)

Hope this helps.

Pete

"Mike" wrote in message
...
Pete

My YES and NO answers are not in seperate columns, they are in the same
column. I used a list to select YES or NO in each cell.

Can you respond please?

"Pete_UK" wrote:

Assume your departments are listed in column A and the yes/no answers
are in column B. List each of your departments in column D starting in
D2 and put "Yes" in E1 and "No" in F1, so that you will have something
like this:

D E F
Yes No
Admin
Personnel
Sales
etc

Then in E2 put this formula:

=SUMPRODUCT((A1:A1000=$D2)*(B1:B1000=E$1))

You can copy the formula into F2, then copy E2:F2 down until you have
covered your list of departments. You will have the count of Yes and
No under those columns for each department - is this what you want?

Hope this helps.

Pete

On Dec 5, 8:27 pm, Mike wrote:
I am having trouble using the countif function with an array. I have
two
columns, one of which is the department column (with department names
in each
cell) and the other column is question column (with YES and NO answers
in
each cell). I want to count the number of YES and NOs for each
department.

I tried to use this countif array function:
{=countin(if((A2:A21="ADMIN"),
B2:B21, ""), "YES")}

Can you help me please? I keep getting the VALUE error.





Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CountIf Array not working NWO Excel Discussion (Misc queries) 1 March 1st 07 07:48 PM
countif within array Grant Excel Worksheet Functions 3 October 26th 06 07:58 AM
Countif array formula Bruce Excel Worksheet Functions 1 October 14th 05 08:46 AM
sumproduct , array or countif? cjjoo Excel Worksheet Functions 5 October 11th 05 04:36 AM
countif array formula Rita Excel Worksheet Functions 3 December 15th 04 04:44 AM


All times are GMT +1. The time now is 09:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"