November 13, 2024
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
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?
Moderators
January 31, 2022
Trusted Members
October 17, 2018
Moderators
January 31, 2022
I agree with Hans that the dates in columns G:K don't seem to make much sense. I guess the are merely examples to show that a payments should show in the weeks starting on those dates.
The attached workbook contains a solution that may be what you are after, based on Power Query. For each payments it determines first day of the week for each of the coming 12 payment dates. The 12 months is hard-coded in this example but can easily be made dynamic. Finally, the amounts are summarized per week.
Finding a formula based solution would be more complicated. At least that's what I believe. Let me know if this is something you could work with.
Trusted Members
October 17, 2018
VIP
Trusted Members
December 7, 2016
Hello,
Attached is a formula version based on what you have entered manually, I might have got the wrong understanding, but it is adjustable so just tweak it till it fits your need. As it is the week number for when the day of month occurs that seems crucial I am checking for the week number, if true then show the value.
Br,
Anders
Trusted Members
October 17, 2018
I tried some things and changed two things, I used Ander's file as a starting point (Try-Outs sheet with many extra formulas.
Your original table converted to an Excel ListObject Table and added formulas toi calculate the week number and the start date of that week
Another sheet with a pivot table and a slicer to filter it
The days due and date due are things you will have to explain better since all are i the past.
A added a duplicate Supplier 01 so it shows up in the Pivot table
The Suppliers are all 01 to 13 so that when you sort them, they remain in the supplier's name in ascending order
Moderators
January 31, 2022
November 13, 2024
Firstly I'd like to thank all the responders for their help. Secondly I need to apologise for the confusion I caused with the odd dates in the example spreadsheet; you will see that I put in a February date to see how any solution would deal with short months.
I am surprised that there isn't an established solution to this already as it seems to me to be something t hat would come up frequently in business.
Finally, I came up with my own solution. It is quite crude but it has the benefit that I understand it and can therefore explain it to my boss, so that he will trust it going forward. Basically I test to see if the string created from the due date is found within a string of the dates within the week in question, entering the amount payable if true, or an empty string otherwise.
=IF(ISNUMBER(SEARCH ("/"&$E11&"/","/"& DAY(J$3+1)&"/"& DAY(J$3+2)&"/"& DAY(J$3+3)&"/"& DAY(J$3+4)&"/"& DAY(J$3+5)&"/"& DAY(J$3+6)&"/")),$F11),"")
I realise that this is probably very inefficient compared to your more sophisticated solutions but any extra processing time is unnoticeable with the modest size of our cashflow model.
Stuart
VIP
Trusted Members
December 7, 2016
Hello Stuart,
If you expand the formula bar you will see the rest of the formula, you can either click on the arrow on far right, press CTRL + SHIFT + U or adjust the field size with the mouse pointer by hovering over the lower edge of the formula bar, when you see a white double pointed arrow, click and drag.
The formula in cell G2 is:
=IF(
(ISOWEEKNUM(G$1)=ISOWEEKNUM(DATE(YEAR(G$1),MONTH(G$1),$C2)))+
(ISOWEEKNUM(G$1)=ISOWEEKNUM(DATE(YEAR(G$1),MONTH(G$1)+1,$C2))),
$E2,"")
Br,
Anders
1 Guest(s)