sum row to find value equal to or less than Cell (B1)

elsg

Active Member
Joined
Mar 16, 2013
Messages
295
Hi.
I have several values ​​in row 2. (B2. G2 .....)
In "B3" I have the value (Stock), which I will use to compare with row 2.
In "B1" will be the result


what I need is:
How to know if the sum of line 2 is equal to or less than "B3"


In my example form 4 cells to arrive at an approximate value of "B3" (10 + 15 + 10 + 10 = 45)
Result4
SumRow101510102015
Stock50

<colgroup><col><col><col span="5"></colgroup><tbody>
</tbody>
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hello, Robert


the result should be in "B1"
and would be the value 4


Hello, jamtay317
I do not understand what you did.
 
Upvote 0
Hello, Robert


the result should be in "B1"
and would be the value 4


Hello, jamtay317
I do not understand what you did.

Are you wanting the sum of a combination that satisfies or wondering which consecutive values from B on sums to the condition specified?

If the latter, control+shift+enter, not just enter:

=MATCH(B3,SUBTOTAL(9,OFFSET(B2,0,0,1,COLUMN(B2:G2)-COLUMN(B2)+1)),1)
 
Last edited:
Upvote 0
Hi
i want the sum of a combination that satisfies

how many cells the formula should sum to be less than or equal to "B1".
 
Upvote 0

Forum statistics

Threads
1,203,562
Messages
6,056,086
Members
444,845
Latest member
dpkane512

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