Sumproduct Combined with Min function

Mooping

New Member
Joined
Jul 17, 2010
Messages
3
Hi all, I have two columns as follows

A B
40 0.5
35 0.2
60 1.25
70 2.00

And would like to Sumproduct the two but constraining the maximum value in column B to 1. Having a separate column that picks up the Min(B,1) is not practical as in practice I have a large number of B type columns.

My first attempt at a solution was
=+SUMPRODUCT($E9:$E1390,(MIN(D9:D1390,1)))
but it returns an error.

Many thanks for your help/suggestions!!
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,203
Try...

=SUMPRODUCT(A1:A4,B1:B4,--(B1:B4<=1))


Hi all, I have two columns as follows

A B
40 0.5
35 0.2
60 1.25
70 2.00

And would like to Sumproduct the two but constraining the maximum value in column B to 1. Having a separate column that picks up the Min(B,1) is not practical as in practice I have a large number of B type columns.

My first attempt at a solution was
=+SUMPRODUCT($E9:$E1390,(MIN(D9:D1390,1)))
but it returns an error.

Many thanks for your help/suggestions!!
 

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
Hi and welcome to the board!!
Code:
=SUM(IF(B1:B4<=1,A1:A4))
This is an array formula, so you must confirm it by using CTRL+SHIFT+ENTER

lenze
 

Mooping

New Member
Joined
Jul 17, 2010
Messages
3
Thanks for the warm welcome and quick suggestions - it strikes me that the proposed answers will only sumproduct if the value in column B is less than 1 and ignores values of column B that are greater than 1 -I'm looking for a solution that takes the value in column B if this is less than 1 and uses 1 if it's greater than 1. Any thoughts?

Thank you very very much!
 

Mooping

New Member
Joined
Jul 17, 2010
Messages
3
Actually, no, you are right. This seems to work like a charm.

Thanks a lot!

Hi and welcome to the board!!
Code:
=SUM(IF(B1:B4<=1,A1:A4))
This is an array formula, so you must confirm it by using CTRL+SHIFT+ENTER

lenze
 

Watch MrExcel Video

Forum statistics

Threads
1,129,683
Messages
5,637,775
Members
416,982
Latest member
lisam77

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