VBA - Count if type function

filmore34

New Member
Joined
Feb 19, 2014
Messages
11
Hello everyone,

I am in need of some help with a count if type statement but I do not think countif will do what I need and I am not familiar with the VBA coding in excel. Currently I have two different workbooks that are wanting to be combined and can be by adding in one column that differentiates the two but for reporting out I need to be able to seperate the two and still count the values. So i have somethign like this and I need to be able to count the number of A, B, C, D, etc in columns 1-3 but have to seperate them into the two different categories of C and NC - I know a pivot table can show these easily and it would be easy without the categorys using a countif statement but seperating it into the two different categories is where i am getting stuck - any help would be appreciated - thanks
[TABLE="width: 500"]
<TBODY>[TR]
[TD]Category[/TD]
[TD]1[/TD]
[TD]2[/TD]
[TD]3[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]b[/TD]
[TD]4[/TD]
[TD]4[/TD]
[/TR]
[TR]
[TD]NC[/TD]
[TD]3[/TD]
[TD]a[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD]NC[/TD]
[TD]2[/TD]
[TD]2[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]C[/TD]
[TD]1[/TD]
[TD]1[/TD]
[TD]b[/TD]
[/TR]
</TBODY>[/TABLE]
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
I was able to us the Sumproduct function to get the desired results - for some reason i was thinking that it had to be an if statement.
=SUMPRODUCT(($A$2:$A$10="NC")*($D$2:$H$10="a"))
 
Upvote 0

Forum statistics

Threads
1,223,905
Messages
6,175,297
Members
452,633
Latest member
DougMo

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