SumProduct to count rows

Posted on 2011-03-14
Last Modified: 2012-06-21
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?
Question by:Lawrence Salvucci
  • 3
  • 2
LVL 39

Accepted Solution

nutsch earned 500 total points
ID: 35130808
Why do you divide by the countif?


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?




Author Comment

by:Lawrence Salvucci
ID: 35130841
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?
LVL 39

Expert Comment

ID: 35130874
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.


Author Closing Comment

by:Lawrence Salvucci
ID: 35131020
Thank you for the help!
LVL 39

Expert Comment

ID: 35131048
Glad to help. Thanks for the grade.


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Sparklines have been introduced with Excel 2010 and are a useful tool for creating small in-cell charts, used for example in dashboards. Excel 2010 offers three different types of Sparklines: Line, Column and Win/Loss. What it does not offer is a…
Dealing with unintended Excel Active-X resizing quirks (VBA code simulates "self correction") David Miller (dlmille) Intro Not everyone is a fan of Active-X controls in spreadsheets (as opposed to the UserForm approach, the older Form controls …
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now