Countif using two criteria

smithrd6

Board Regular
Joined
Dec 13, 2005
Messages
150
I have a worksheet which contains a column for part numbers and another for tag issue numbers. Not every occurance of part number will have a tag number issued. What I want to do is count the number of times a certain part number will have an occurance of a tag issue number.

PN Tag Issue Number

123 343
124 454
125 333
123
123 354

I'm not concerned with the blanks,

thanks
 

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
I understand it more like this:

=Sumproduct(--($A$1:$A$10=C1),--($B$1:$B$10<>""))

where C1 holds the part number to check for. Formula can be copied down.
 
Upvote 0
sumproduct not working

I tried this with the only results being 0. For some reason, it will not pick up the part number.

=SUMPRODUCT(--($I$2:$I$41000=A4),--($J$2:$J$41000<>""))
 
Upvote 0
Re: sumproduct not working

I tried this with the only results being 0. For some reason, it will not pick up the part number.

=SUMPRODUCT(--($I$2:$I$41000=A4),--($J$2:$J$41000<>""))

Make sure that the part in A4 has no spaces prior to or after as well as your data in column I. There have to be exact matches.

If this works, you know there are extraneous spaces.

=SUMPRODUCT(--(Trim($I$2:$I$41000)=Trim(A4)),--($J$2:$J$41000<>"")) but you will notice are marked slowdown in processing...so you shouldn't really use it. Instead fix your entries. You can find a TrimAll macro by doing a forum search that will clean up for you.

If it doesn't work, then are you sure there is at least one exact match?
 
Upvote 0

Forum statistics

Threads
1,213,531
Messages
6,114,167
Members
448,554
Latest member
Gleisner2

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