# SumProduct to count rows

In the attached file I am trying to count the number of rows in my sumproduct formula but it doesn't seem to be working correctly. If you look in cell E6 you can see the formula with the criteria's but when you verify the correct count it's a lot larger than what the formula is saying. Anyone know what is wrong with my formula?
Sample-File.xls
LVL 1
###### Who is Participating?
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:
Why do you divide by the countif?

=SUMPRODUCT((Database!\$E\$2:\$E\$7559>=\$B6)*(Database!\$E\$2:\$E\$7559<=\$D6)*(Database!\$D\$2:\$D\$7559>=66)*(Database!\$B\$2:\$B\$7559<\$A\$6))

works and matches your data, but then you divide by COUNTIF(Database!\$A\$2:\$A\$7559,Database!\$A\$2:\$A\$7559&"")

Can you restate your needs if the first formula doesn't address them?

Thanks,

Thomas

0

Experts Exchange Solution brought to you by ConnectWise

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

Information Technology ManagerAuthor Commented:
I thought I needed a countif to count the criteria. So a sumproduct counts the number of rows returned with you use the * between criterias?
0

Commented:
It counts when you don't multiply it by a range of values. Right now, you have =sumproduct(test*test*test*test), each test returns an array of 1s and 0s. When all test conditions are met, you get a line of 1s which multiplied together return 1. If one or more tests aren't met, you get 0, sumproduct then totals all the ones, which gives you the count of rows.

Thomas
0

Information Technology ManagerAuthor Commented:
Thank you for the help!
0

Commented:

Thomas
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.