Formula MIN, MAX, Sumproduct, etc.

billythedj66

Board Regular
Joined
Jan 6, 2003
Messages
126
Hell all.
I've been racking my brain on this one, and I cannot seem to get it to work:

Worksheet 'Stats' has a list with the following:
Column 'C3:C1003' is a list of locations (Green, Jones, Green, Tom, etc.)
Column 'P3:P1003' is a list with number data (18,18,16,18, etc.)
Column 'BF3:BF1003' is a list with number data (106,133,125,118,etc.)

On another worksheet 'Breakdown', D3 cell has a work location.

In cell c19 I want the following:
The maximum number of 'BF3:BF1003' whereas 'C3:C1003' = D3 and 'P3:P1003'=18.

I tried the following:
=SUMPRODUCT(MAX(('Stats'!$C$3:$C$1003=$C$3),--('Stats'!$P$3:$P$1003=18)+0,('Stats'!BF$3:BF$1003)))

That gave me the maximum number in 'BF3:BF1003' regardless of the criteria.

In C20, I want the minimum number, I tried the following:
=SUMPRODUCT(MIN(('Stats'!$C$3:$C$1003=$C$3),--('Stats'!$P$3:$P$1003=18)+0,('Stats'!BF$3:BF$1003)))

That gave me a value of 0.

Any ideas would be greatly appreciated.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
Hell all.
I've been racking my brain on this one, and I cannot seem to get it to work:

Worksheet 'Stats' has a list with the following:
Column 'C3:C1003' is a list of locations (Green, Jones, Green, Tom, etc.)
Column 'P3:P1003' is a list with number data (18,18,16,18, etc.)
Column 'BF3:BF1003' is a list with number data (106,133,125,118,etc.)

On another worksheet 'Breakdown', D3 cell has a work location.

In cell c19 I want the following:
The maximum number of 'BF3:BF1003' whereas 'C3:C1003' = D3 and 'P3:P1003'=18.

I tried the following:
=SUMPRODUCT(MAX(('Stats'!$C$3:$C$1003=$C$3),--('Stats'!$P$3:$P$1003=18)+0,('Stats'!BF$3:BF$1003)))

That gave me the maximum number in 'BF3:BF1003' regardless of the criteria.

For statistics like Max, Min, Average, etc., a SumProduct formula is not the right solution...

Instead control+shift+enter:

=MAX(IF('Stats'!$C$3:$C$1003=$C$3,IF('Stats'!$P$3:$P$1003=18,'Stats'!BF$3:BF$1003)))

In C20, I want the minimum number, I tried the following:
=SUMPRODUCT(MIN(('Stats'!$C$3:$C$1003=$C$3),--('Stats'!$P$3:$P$1003=18)+0,('Stats'!BF$3:BF$1003)))

That gave me a value of 0.

Replace MAX with MIN in the above formula.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,329
Messages
5,769,462
Members
425,551
Latest member
yeat

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
Top