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
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

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?
 

Watch MrExcel Video

Forum statistics

Threads
1,108,818
Messages
5,525,077
Members
409,618
Latest member
gkllc

This Week's Hot Topics

Top