Solved

SumProduct to count rows

Posted on 2011-03-14
5
347 Views
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?
Sample-File.xls
0
Comment
Question by:Lawrence Salvucci
  • 3
  • 2
5 Comments
 
LVL 39

Accepted Solution

by:
nutsch earned 500 total points
ID: 35130808
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
 
LVL 1

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?
0
 
LVL 39

Expert Comment

by:nutsch
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.

Thomas
0
 
LVL 1

Author Closing Comment

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

Expert Comment

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

Thomas
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

743 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

10 Experts available now in Live!

Get 1:1 Help Now