SumProduct formula is counting instead of summing

gazz

New Member
Joined
Aug 15, 2008
Messages
16
With help from this forum I've used SumProduct many times but I've been going round in circles for the past couple of days with a formula which won't stop counting results instead of summing them, I'm sure I'm missing something obvious so any help would be greatly appreciated.

I'm using Excel 2003 and Windows XP Professional.

I have a report which can be hundreds of lines long which shows product deliveries by product code and method of despatch (MOD). As this is a stock item deliveries are shown as negatives and credits as positive numbers. I want to sum the credits (i.e. positive numbers) by product code and MOD.

Here's my sample data:
DEF
1ProductsTonnesMOD
2BPRHHP20Road
3BPPCHP40Road
4BPPCHP-35
5BPBAGHP-700Rail
6BPPCHP-319Rail
7BPPCHP26Collect
8BPPCHP1300Rail
9BPPCHP-1300Rail
10BPRHHP-1800Rail
11

<tbody>
</tbody>


The report will be of variable length so I'll be using INDIRECT references in the final formula but for this post I've used fixed cell addresses.

So my typical formula is =SUMPRODUCT(($D$2:$D$10=$H15)*($F$2:$F$10=I$6)*($E$2:$E$10>0)). This is duplicated across a table with Product Codes down the left side and MOD's along the top and the formula replicated accordingly.

If I remove the >0 in the last part of the formula it correctly sums each product by MOD so for example BPPCHP by Rail would be -319 (the sum of rows 6, 8 & 9). But when I add the >0 to sum the positive values, instead of giving the sum i.e. 1300 in this example it returns 1, the count.

I've tried using * instead of commas without success and using INDIRECT references returns the count as well. I thought it might be to do with the original report being loaded from a .csv file but I typed the above example with the same result.

Can anybody can see where I'm going wrong?

Thanks for looking.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Maybe tacking on just the $E$2:$E$10 (which speaks to the sum part)... Give it a try.

=SUMPRODUCT(($D$2:$D$10=$H15)*($F$2:$F$10=I$6)*($E$2:$E$10>0)*$E$2:$E$10)
 
Upvote 0

Forum statistics

Threads
1,214,919
Messages
6,122,259
Members
449,075
Latest member
staticfluids

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