Create cash flow from list of regular payments due

El Rebelde

New Member
Joined
Nov 15, 2024
Messages
4
Office Version
  1. 365
Platform
  1. Windows
I have a spreadsheet with rows showing payments and the day in the month that they are due. There are also columns showing the weeks of the year, identified by their start dates. I would like to add the payment due for that row in any week where the date due falls between the start date and end date for that week.

The file attached has been populated manually to show what I'm trying to achieve. Can anyone help, please?
 

Attachments

  • Capture.PNG
    Capture.PNG
    43 KB · Views: 17

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
Hello, If I understand it correctly then maybe:

Excel Formula:
=DROP(REDUCE("",G1:K1,LAMBDA(a,b,HSTACK(a,IF(BYROW(--(C2:C14=DAY(SEQUENCE(,7,b))),LAMBDA(x,SUM(x))),E2:E14,"")))),,1)
 
Upvote 0
Thank you, but what are the elements a, b and x? The trouble is that I've no knowledge or experience of these functions to work out why I get a #SPILL error!!
 
Upvote 0
Hello, a, b, x are custom variable names which represent every element of an array (e.g. x stands for each row that is to be summed). #SPILL error probably results from the fact that there are some data within the range which prevent the formula from providing the result - you could either delete the data or copy the inputs elsewhere to check what the formula returns. Or if you would prefer a formula that returns results for each cell individually it is possible to adjust the formula...
 
Upvote 0
Thanks for your help but I couldn't make that work. Having rested my brain over the weekend I've come up with a formula that I understand and that works! It looks for the day that the payment is due within a string made up of the DAY() values of the week start date and the following six days. If found it returns the payment value, otherwise a blank. (The slashes are to prevent single digits being found in double digit DAY() values.)

=IF(ISERROR(FIND(("/"&TEXT($C9,0)&"/"),"/"&DAY(I$1)&"/"&DAY(I$1+1)&"/"&DAY(I$1+2)&"/"&DAY(I$1+3)&"/"&DAY(I$1+4)&"/"&DAY(I$1+5)&"/"&DAY(I$1+6))&"/"),"",$E9)
 
Upvote 0
Thanks for your help but I couldn't make that work. Having rested my brain over the weekend I've come up with a formula that I understand and that works! It looks for the day that the payment is due within a string made up of the DAY() values of the week start date and the following six days. If found it returns the payment value, otherwise a blank. (The slashes are to prevent single digits being found in double digit DAY() values.)

=IF(ISERROR(FIND(("/"&TEXT($C9,0)&"/"),"/"&DAY(I$1)&"/"&DAY(I$1+1)&"/"&DAY(I$1+2)&"/"&DAY(I$1+3)&"/"&DAY(I$1+4)&"/"&DAY(I$1+5)&"/"&DAY(I$1+6))&"/"),"",$E9)
To avoid the string of days I have used SEQUENCE and MATCH.

Copy the formula from G2 along and down.

Blue cells contain formula so that F9 will generate random data for testing,

Cell Formulas
RangeFormula
C2:C14C2=RANDBETWEEN(1,28)
D2:D14D2=DATE(2024,1,C2)
E2:E14E2=RANDBETWEEN(100,1000)
G2:K14G2=LET(f,ISNUMBER(MATCH($C2,SEQUENCE(1,7,DAY(G$1),1),0))*$E2,IF(f<>0,f,""))
 
Upvote 0
That looks great; I look forward to trying that out on my actual data later. Thank you so much!
 
Upvote 0
That looks great; I look forward to trying that out on my actual data later. Thank you so much!
I look forward to your response.

When a post relies on having some data to put together a solution use XL2BB as it avoids others having to create some realistic data.

 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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