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

#### elsg

##### Active Member
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)
 Result 4 SumRow 10 15 10 10 20 15 Stock 50

<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.
=if(sum(b2:g2)<=b3,sum(b2:g2),"")

Like this?
Excel Workbook
ABCDEFGH
1Result4
2SumRow101510102015
3Stock50
4
5yes
Sheet1

Hello, Robert

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

Hello, jamtay317
I do not understand what you did.

did the fourmula not work?

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:
Hello, Robert

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

Hello, jamtay317
I do not understand what you did.
I think that you could use =if(sum(b2:g2)<=b3,sum(b2:g2),"There is enough stock")

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".

what is the range that your trying to add?

Last edited:

Replies
3
Views
149
Replies
1
Views
103
Replies
2
Views
80
Replies
1
Views
71
Replies
3
Views
98

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?

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