# EXCEL COUNT OR SUM IF WITH DUPLICATES PROBLEM??

I have an issue that I don't know is possible to do without doing it by hand.  Please open the excel file before proceeding.

I have a list of parts that are classified by component.  The fields BXZ,ROAD,STUNT,CRUISER are boolean not actual part counts.  They are 1 if that part is needed for that component for that model or 0 if not.  Some parts are multiuse.

To the right I have a "complexity matrix".  I can use sumif and count if to get total part complexity and permodel complexity.  the problem comes when I need to bucket to models together.  I can not just add them because of the common parts.  I have included the correct answer just by counting them and typing it in myself.

What I need is a forumula/method for figuring cells q3 and r3 out correctly without doing it by hand.

Any thoughts?
ComplexityExample.xlsx
LVL 2
###### Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Commented:
Should it be 5 rather than 4 for WHEEL for BMX & STUNT?
Commented:
If so, then:
=SUMPRODUCT((\$A\$3:\$A\$14=J3)*((D3:D14+F3:F14)>0))
Author Commented:
I am sorry you are correct.  The other thing I forgot to put is it needs to be vlookup style.  I mean I will have a list of 100 components of varying part numbers.  So I can't reference cells directly.
Commented:
I'm not sure what you mean by "vlookup style". Can you clarify?
Commented:
Wouldn't the answer be 5 for BMX and Stunt? 234,4561,53113,5463, and 2323 are 5 parts...

Assuming I am correct:

=SUM((D3:D8&F3:F8="10")*1)+SUM((D3:D8&F3:F8="01")*1)+SUM((D3:D8&F3:F8="11")*1)

This is an array formula, so press Ctrl-Shift-Enter when you finish typing it.

Experts Exchange Solution brought to you by

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Author Commented:
This actually works but can you explain how?  Sorry but it has just driven me nuts.
Author Commented:
I am sorry I mean rorya's works.
Commented:
It checks if each item in col A matches J3 (WHEEL) and returns either True or False.
It then checks if adding up the values in col D and F is more than 0 and returns True or False
These two arrays of True/False values are then multiplied together (in Excel, TRUE=1, FALSE=0) to give a final array of 1s and 0s and then adds these up.
Does that make sense?
###### It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Excel

From novice to tech pro — start learning today.