Add up to a specified number

barrai

New Member
Joined
Nov 25, 2015
Messages
3
hi
I have a list of customers purchases in a1:a20. I have one number as a basis for example in D1 (d1=500)
How to calculate sum of row a1 until which row is 500.

1.jpg
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
You say calculate sum of row A1, which are characters not a numbers? Also do you wish to calculate values under the value of D1 or do you want to calculate values up to row 500?
 
Upvote 0
i want calculate sum of numbers from a1 to any row when total equal or grater than d1.
for example in up image ,B2+B3+B4+B5 is our answer.
 
Upvote 0
Hey barrai,
You need to create a helper column in column C which shows the running total of column B and then use the below function.

=IFERROR(SUMPRODUCT(OFFSET(B1,1,0,MATCH(E1,C2:C21,1)+1)),C2)

Hope this help.


<colgroup><col span="2"><col><col span="2"></colgroup><tbody>
</tbody>
 
Upvote 0
i want calculate sum of numbers from a1 to any row when total equal or grater than d1.
for example in up image ,B2+B3+B4+B5 is our answer.

Hi,

Not sure what you want as a result at All, you need to be more specific.

Take your pick.


Book1
ABCDE
1CustomerPurchase500
2a221221bCustomer b in Column A when Sum reaches 500+
3a1503714Row 4 in Column B (Not including Header row) when Sum reaches 500+, meaning 340
4a95466$A$5Cell address of Customer when Sum reaches 500+
5b340806$B$5Cell address of Purchase when Sum reaches 500+
6c4391245
7c2331478
8c2081686
9c2401926
10c2632189
11d2992488
Sheet165
Cell Formulas
RangeFormula
C2=SUM(B$2:B2)
D2=INDEX(A2:A11,MATCH(D1,C2:C11,1)+1)
D3=MATCH(D1,C2:C11,1)+1
D4=CELL("address",INDEX(A2:A11,MATCH(D1,C2:C11,1)+1))
D5=CELL("address",INDEX(B2:B11,MATCH(D1,C2:C11,1)+1))


C2 formula copied down.
 
Upvote 0

Forum statistics

Threads
1,214,947
Messages
6,122,413
Members
449,082
Latest member
tish101

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