Excel Formula Question - SUM future payments until specified value is reached

steedev

New Member
Joined
Mar 6, 2018
Messages
5
Hi,

This is my first time posting, hopefully someone can help.

Spreadsheet.jpg


I have a list of times and a matching list of payments - Times in cells C4:C14 and payments in cells D4:D14.
I have formulas to show the time of the next payment in cell F4 {=MIN(IF(C4:C14>(NOW()-TODAY()),C4:C14))}
and one to show the next payment amount in cell G4 =INDEX(D4:D14,MATCH(F4,C4:C14,0))

The bit I am struggling with is a formula to find the time when my balance (in cell F7) plus the sum of future payments reaches 10.
At the moment I have the following formula which involves many nested IF statements.

=IF(F7+INDIRECT("D"&H7)<10,
IF(F7+INDIRECT("D"&H7+1)<10,
IF(F7+INDIRECT("D"&H7+2)<10,
IF(F7+INDIRECT("D"&H7+3)<10,
IF(F7+INDIRECT("D"&H7+4)<10,
IF(F7+INDIRECT("D"&H7+5)<10,
IF(F7+INDIRECT("D"&H7+6)<10,
IF(F7+INDIRECT("D"&H7+7)<10,
IF(F7+INDIRECT("D"&H7+8)<10,
IF(F7+INDIRECT("D"&H7+9)<10,
IF(F7+INDIRECT("D"&H7+10)<10,
"OVER 10",
INDIRECT("C"&H7+10)),
INDIRECT("C"&H7+9)),
INDIRECT("C"&H7+8)),
INDIRECT("C"&H7+7)),
INDIRECT("C"&H7+6)),
INDIRECT("C"&H7+5)),
INDIRECT("C"&H7+4)),
INDIRECT("C"&H7+3)),
INDIRECT("C"&H7+2)),
INDIRECT("C"&H7+1)),
INDIRECT("C"&H7))

In this formula the cell H7 is used as the row counter for the next payment, derived from cell F4.
It is functional in this example data but not practical in my real data as there are many more than 64 entries which I believe is the maximum number of nested IF statements.

Is there an easier and nicer way to find the next payment and then add the SUM of future payments to my balance until a value of 10 is reached? At this point I would like to display the time at which a balance of 10 is reached.

I hope this is clear and thanks in advance for any help.
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Welcome to the board.

I couldn't see your screenshot, and your description was a little unclear to me, but maybe something like this:

CDEFG
41-Mar11-Mar1
52-Mar2
63-Mar3
74-Mar434-Mar
85-Mar5
96-Mar6
107-Mar7
118-Mar8
129-Mar9
1310-Mar10
1411-Mar11

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
G4=INDEX(D4:D14,MATCH(F4,C4:C14,0))

<tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
F4{=MIN(IF(C4:C14>NOW()-TODAY(),C4:C14))}
G7{=INDEX(C4:C14,MATCH(10,F7+SUBTOTAL(9,OFFSET(D4,0,0,ROW(D4:D14)-ROW(D4)+1)))+1)}

<tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>



The formula shows the date where the sum of F7 and D:D first exceeds 10. If the sum is exactly 10, it shows the next row. It's probably not exactly what you need, since I couldn't be sure of your requirements, but you may be able to adapt it.
 
Last edited:
Upvote 0
Hi Eric,
This formula appears to work well, thank you.
The only adaptation I would like to make is so that it only counts values that are in the future based on the current time of day.

Thanks for your help
 
Upvote 0
OK, give this a shot:

CDEFG
48:00112:005
59:002
610:003
711:004314:00
812:005
913:001
1014:007
1115:008
1216:009
1317:0010
1418:0011

<colgroup><col style="width: 25pxpx"><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
G4=INDEX(D4:D14,MATCH(F4,C4:C14,0))

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>

Array Formulas
CellFormula
F4{=MIN(IF(C4:C14>NOW()-TODAY(),C4:C14))}
G7{=INDEX(C4:C14,MATCH(10,F7+SUBTOTAL(9,OFFSET(INDEX(D4:D14,MATCH(NOW()-TODAY(),C4:C14)+1),0,0,ROW(D4:D14)-ROW(D4)+1)))+MATCH(NOW()-TODAY(),C4:C14)+1)}

<thead>
</thead><tbody>
</tbody>
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,215,206
Messages
6,123,638
Members
449,109
Latest member
Sebas8956

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