Conditional SUMPRODUCT to also ignore blanks

cfdh_edmundo

Board Regular
Joined
Nov 9, 2005
Messages
133
Hi,

I have the following code which calculates a weighted average:

Rich (BB code):
=SUMPRODUCT(--($U$2:$U$1203=AE3),$AB$2:$AB$1203,$C$2:$C$1203)/SUMIF($U$2:$U$1203,AE3,$C$2:$C$1203)

It works very well except that I would like it to ignore blank cells in the range $AB$2:$AB$1203

I tried to change it to the following code

Rich (BB code):
=SUMPRODUCT(--($U$2:$U$1203=AE3),$AB$2:$AB$1203,(LEN($AB$2:$AB$1203)>0),$C$2:$C$1203)/SUMIF($U$2:$U$1203,AE3,$C$2:$C$1203)

But this doesn't work and just gives me zero for everything.

If anyone could let me know how I do this that would be great.

Many thanks!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Re: Help with conditional SUMPRODUCT to also ignore blanks

The double negative in front of this bit:

--(U2:U1203=AE3)

is there to convert a TRUE/FALSE result into a 1 or 0 result. You need the double negative in front of your new TRUE/FALSE test.
 
Upvote 0

Forum statistics

Threads
1,224,735
Messages
6,180,640
Members
452,992
Latest member
TokugawaIesuma

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top