SUMPRODUCT(MAX( Question

brans1982

Active Member
Joined
Mar 25, 2009
Messages
263
Hi,

I'm having an issue with a Sumproduct using the max function.

This formula works fine...

=SUMPRODUCT(MAX((Data!$A$2:$A$48=$C$6)*(Data!$G$2:$G$48=$D49)*(Data!$L$2:$L$48)))

And so does the below until I copy it past Row 48...

=SUMPRODUCT(MAX((MONTH(Data!$A$2:$A$48)=9)*(Data!$G$2:$G$48=$D49)*(Data!$L$2:$L$48)))

At the minue, my data on the Data! sheet finishes on Row 48. It's got something to do with the fact I've inserted the MONTH Function into the formula.

Anybody any ideas? Thanks!
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hey,

I was getting a value error. Figured it out, I enetered it as an array formula and it worked fine. Then because of that, I could get rid of the SUMPRODUCT and enter it as....

{=MAX((MONTH(Data!$A$2:$A$48)=9)*(Data!$G$2:$G$48=$D49)*(Data!$L$2:$L$48))}
 
Upvote 0
Same formula with using IF
as i know using if with this CSE formula is better than without iF
=MAX(IF(MONTH(Data!$A$2:$A$48)=9,IF(Data!$G$2:$G$48=D49,Data!$L$2:$L$48)))
 
Upvote 0
Wrapping a formula with the SumProduct function in order to avoid applying control+shift+enter does not look as a 'good practice'.

Also, as suggested by Yahya, using IFs for filtering in lieu of pairwise multiplications is a better choice. I believe moreover that adding a year test would be correct unless the year is not important at all...

Control+shift+enter, not just enter:

=MAX(IF(Data!$A$2:$A$48-DAY(Data!$A$2:$A$48)+1=D48,IF(Data!$G$2:$G$48=D49,Data!$L$2:$L$48)))

where D48 houses a date criterion like:

1-Sep-2011
 
Upvote 0
Or you could:

=SUMPRODUCT(MAX((A1:A10=E2)*(B1:B10)))+SUMPRODUCT(MAX((A1:A10=E2)*(C1:C10)))

E2 is where the letter is your looking to sum
A1:A10 being where your letters.
B1:B10 first figures
C1:C10 second figures
 
Upvote 0
Or you could:

=SUMPRODUCT(MAX((A1:A10=E2)*(B1:B10)))+SUMPRODUCT(MAX((A1:A10=E2)*(C1:C10)))

E2 is where the letter is your looking to sum
A1:A10 being where your letters.
B1:B10 first figures
C1:C10 second figures

Why? The thread in fact revolves around the fact that SumProduct should not be used as a substitute for the control+shift+enter key combination.
 
Upvote 0

Forum statistics

Threads
1,224,607
Messages
6,179,871
Members
452,949
Latest member
Dupuhini

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