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

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
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.
 

smithrd6

Board Regular
Joined
Dec 13, 2005
Messages
150
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<>""))
 

NBVC

Well-known Member
Joined
Aug 31, 2005
Messages
5,828
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?
 

Forum statistics

Threads
1,141,227
Messages
5,705,141
Members
421,380
Latest member
Nuwan Sanjeewa Aponso

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
Top