Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SUMPRODUCT formula problem 1

Status
Not open for further replies.

Smoothas

IS-IT--Management
May 1, 2002
93
GB
Hello again,
One of the very helpful Forum Members (Skip) told me how to code a SUMPRODUCT formula to check Column A for one Variable, and another Column for yet another variable, and then sum up yet another different column, ie :-

=SUMPRODUCT((A1:A64999="LONLB")*(I1:I64999<>0)*(G2:G65000))

This was working great, untill I had to move some data around into new cell referance etc, and now the product that this command produces is different to the actual total.
For example, the code above should produce a output of 83070.55, but actually gives me 209392.7.

Attahced is some sample, depersonallized data with the fomula in question

Thanks in advance for any help ( as I'm sure it's something I'm doing wrong )
 
ALL references must have the same row range!!!
[tt]
=SUMPRODUCT((A2:A64999="LONLB")*(I2:I64999<>0)*(G2:G64999))
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
HI Skip,
thanks for coming to my aid again.
I tried changing the range, but now I get #N/A instead of a wrong SUM.
I also change all 64999 to 67 (to match the number of row in the demo data ) and got the same result. Again, I change the 64999 to 65000, and got #N/A.

 



Using YOUR sheet and the formula I pasted, I get...
[tt]
105001.85
[/tt]


Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
BTW, the #NA value indicates an INVALID VALUE in one of your ranges. Check HELP for more info.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Once I cut and pasted your code into the sheet, it worked. Strange how changing the exiting code failed.
Never mind.
The code was almost what I needed. Rather than the total of G, I need to the Total of I ( J, K ) etc if the vaule in that column is not 0.
I change G refferance to the column I needed and got the result.

Thank you yet again Skip
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top