Solved

I need an excel formula corrected

Posted on 2011-03-07
6
310 Views
Last Modified: 2012-05-11
When I am trying to use the following formula, I get (0) returned and I know there should be a large number:

=SUMPRODUCT(((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1))>0)*(((Mansfield!$H$2:$H$10000<=$Q$1)+(Mansfield!$I$2:$I$10000<=$Q$1))>0)*(Mansfield!$J$2:$J$10000)*(Mansfield!$K$2:$K$10000="N")

If I use this one, I get an anwser:

 =SUMPRODUCT((Mansfield!$C$2:$C$10000=DATA!A5)*(((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1))>0)*(((Mansfield!$H$2:$H$10000<=$Q$1)+(Mansfield!$I$2:$I$10000<=$Q$1))>0)*(Mansfield!$J$2:$J$10000)*(Mansfield!$K$2:$K$10000="N"))

The only difference is ((Mansfield!$C$2:$C$10000=DATA!A5), which is a column and reference for a persons name. I am wanting the total for the values and am not looking for a specific name. Do I have some parenthesis out of whack?
0
Comment
Question by:wrt1mea
6 Comments
 
LVL 59

Accepted Solution

by:
Saurabh Singh Teotia earned 250 total points
ID: 35061796

This should work...

=SUMPRODUCT((((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1))>0)*(((Mansfield!$H$2:$H$10000<=$Q$1)+(Mansfield!$I$2:$I$10000<=$Q$1))>0)*(Mansfield!$J$2:$J$10000)*(Mansfield!$K$2:$K$10000="N"))

If this is not working can you post worksheet...

Saurabh...
0
 
LVL 85

Assisted Solution

by:Rory Archibald
Rory Archibald earned 250 total points
ID: 35061799
Yes:

=SUMPRODUCT((((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1))>0)*(((Mansfield!$H$2:$H$10000<=$Q$1)+(Mansfield!$I$2:$I$10000<=$Q$1))>0)*(Mansfield!$J$2:$J$10000)*(Mansfield!$K$2:$K$10000="N"))
0
 
LVL 1

Author Closing Comment

by:wrt1mea
ID: 35062107
Both worked! Anyone care to explain what i did wrong?
0
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 50

Expert Comment

by:barry houdini
ID: 35062141
I think the parentheses were out as you suggested - in fact you can get rid of some more - this should work

=SUMPRODUCT(((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1)>0)*((Mansfield!$H$2:$H$10000<=$Q$1)+(Mansfield!$I$2:$I$10000<=$Q$1)>0)*(Mansfield!$K$2:$K$10000="N"),Mansfield!$J$2:$J$10000)

regards, barry
0
 
LVL 1

Author Comment

by:wrt1mea
ID: 35062493
For some reason I always thought that if you opened the formula with 3 parentheses, you had to close it with that number too...
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 35063177
Well, you obviously have to match the parentheses, for every one you open you must close one....but you can still do that correctly and get the formula wrong......

...in this formula (your first one)

=SUMPRODUCT(((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1))>0)*(((Mansfield!$H$2:$H$10000<=$Q$1)+(Mansfield!$I$2:$I$10000<=$Q$1))>0)*(Mansfield!$J$2:$J$10000)*(Mansfield!$K$2:$K$10000="N")

.....you are missing a parenthesis at the start so in fact the SUMPRODUCT ends too early.......it's only this part

=SUMPRODUCT(((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1))>0)

because by that point you have closed as many parentheses as you have opened, so SUMPRODUCT is finished....and in the above there is no "co-ercer" [you aren't multiplying by anything or using *1 etc,] so it will always give a result of zero....then the rest of the formula will be irrelevant because whatever it is, you are multiplying by zero...so the result is going to be zero. Perhaps simpler to write like this

=SUMPRODUCT(
((Mansfield!$H$2:$H$10000>$P$1)+(Mansfield!$I$2:$I$10000>=$P$1)>0)+0,
((Mansfield!$H$2:$H$10000<=$Q$1)+(Mansfield!$I$2:$I$10000<=$Q$1)>0)+0,
(Mansfield!$K$2:$K$10000="N")+0,
Mansfield!$J$2:$J$10000
)

The function name and the opening bracket is on line 1 and the last line is just the closing bracket. Lines 2 , 3 and 4 are individula conditions and in each of those the brackets must match, line 5 is the sum range which doesn't need any.....

regards, barry

0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Approximate matching with VLOOKUP and MATCH seems to me to be a greatly under-used technique, and one which is vital for getting good performance out of large lookups. Until recently I would always have advised using an exact match for simplicity an…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
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…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

809 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