SUMPRODUCT

  • Thread starter Thread starter s2m via OfficeKB.com
  • Start date Start date
S

s2m via OfficeKB.com

The number that is calculated is correct if I do not use (--(TCS!$E$2:$E
$1000="GDS"). Do I have the brackets in the right place?


=IF(SUMPRODUCT(--(TCS!$E$2:$E$1000="GDS"),--(TCS!$Z$2:$Z$1000=H2),--(TCS!$AA
$2:$AA$1000<>""))<>0,SUMPRODUCT(--(TCS!$Z$2:$Z$1000=H2),--(TCS!$AA$2:$AA
$1000<>"")),"")

Thanks

Sharon
 
It looks OK.
could the "GDS" cells have trailing or leading spaces ?
try

=IF(SUMPRODUCT(--(Trim(TCS!$E$2:$E$1000)="GDS"),--(TCS!$Z$2:$Z$1000=H2),--(TCS!$AA$2:$AA$1000<>""))<>0,SUMPRODUCT(--(TCS!$Z$2:$Z$1000=H2),--(TCS!$AA$2:$AA$1000<>"")),"")
 
It looks like you've omitted the following condition from the second
SUMPRODUCT function...

--(TCS!$E$2:$E$1000="GDS")

Also, consider simply using...

=SUMPRODUCT(--(TCS!$E$2:$E$1000="GDS"),--(TCS!$Z$2:$Z$1000=H2),--(TCS!$AA
$2:$AA$1000<>""))

....and custom formatting the cell to hide a zero value...

Format > Cells > Number > Custom > Type: [=0]""

Note that the underlying value is still 0.

Hope this helps!
 
Excellent!! It works

Thanks so much
It looks like you've omitted the following condition from the second
SUMPRODUCT function...

--(TCS!$E$2:$E$1000="GDS")

Also, consider simply using...

=SUMPRODUCT(--(TCS!$E$2:$E$1000="GDS"),--(TCS!$Z$2:$Z$1000=H2),--(TCS!$AA
$2:$AA$1000<>""))

...and custom formatting the cell to hide a zero value...

Format > Cells > Number > Custom > Type: [=0]""

Note that the underlying value is still 0.

Hope this helps!
The number that is calculated is correct if I do not use (--(TCS!$E$2:$E
$1000="GDS"). Do I have the brackets in the right place?
[quoted text clipped - 6 lines]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top