# Add up to a specified number

#### barrai

##### New Member
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.

### Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand

#### Timbo50

##### New Member
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?

#### barrai

##### New Member
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.

#### Syed Ali Raza

##### New Member
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.

 C:\Users\User\Desktop\Query

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

#### jtakw

##### Well-known Member
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.

C2 formula copied down.

Replies
4
Views
86
Replies
9
Views
30
Replies
1
Views
43
Replies
0
Views
29
Replies
2
Views
63