CountIf multiple parameters - is it possible?

theDrew

Board Regular
Joined
May 6, 2003
Messages
104
I have inherited an Excel database that looks somethign like this. I can't change the structure of the database since employees in the field are currently using it on a project.

The employee enters a company name in the first column. In the response column, the employee enters a 1 for the correponding response, and all other responses are marked as 0. In the field marked ???? I need to return a number such as "How many employees entered IBM as a company and 3 as a response?" The only function that I can think to use is CountIf, but how can I enter multiple parameters with CountIf? I could use VBA but the list of companies and possible responses is huge.

and while I am here, anyone know why those two tab characters are showing in C10 and D10?

Thanks!!
Pasta1.xls
ABCD
1CompanyResponse1Response2Response3
2IBM100
3HP010
4IBM010
5IBM100
6Dell001
7Dell001
8IBM010
9Dell100
10Total????
Plan3
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Use SUMPRODUCT like this:

=SUMPRODUCT((A1:A9="IBM")*(B1:B9=1))

You can replace the values after the = with a cell reference.
 
Upvote 0
theDrew said:
thanks that worked!! :wink:

If so, I'd suggest using a SumIf formula that suits your set up...
Book2
ABCDE
1CompanyResponse1Response2Response3
2IBM100
3HP010
4IBM010
5IBM100
6Dell001
7Dell001
8IBM010
9Dell100
10
11IBM220
12
Sheet1


B11:

=SUMIF($A$2:$A$9,$A11,B2:B9)

which is copied across.
 
Upvote 0
theDrew said:
...The only function that I can think to use is CountIf, but how can I enter multiple parameters with CountIf? ...quote]

Use...

{=COUNT(IF(condition1,IF(condition2,...,1)))}

...or, simply use the Conditional Sum Wizard to construct your formula.
 
Upvote 0
actually I am making dummy variables so that I CAN build a pivot table. The workbook has a huge number of columns and rows, and I am building the dummy variables to compact the information as much as possible before putting it into a pivot table. Otherwise, it looks very disorganized and unprofessional.
 
Upvote 0

Forum statistics

Threads
1,214,596
Messages
6,120,438
Members
448,966
Latest member
DannyC96

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