Dashboards
Power Query
Power Pivot
Pivot Tables Quick Start
August 11, 2023
I have two conundrums that I'm struggling to find a sensible solution to.
1. (Daily Pricing)
I have a list of contracts with start and end dates, and I want to multiply the daily price based on the number of days within each fiscal period.
2. (Monthly Pricing)
This one is a little more complex, but I blame our accountant. For this one the Daily Price is calculated using the monthly price, divided by the number of days in the month. i.e. Price of £1,000 a month in January has a daily rate of £32.26, but in February it would be £35.71. As the fiscal periods usually spread over two months, the total for the period would be the daily rate for month 'A' multiplied by the number of days from that fall into that fiscal period, plus, the daily rate for month 'B' multiplied by the number of days from that fall into that fiscal period.
Any help is massively appreciated!
Trusted Members
Moderators
November 1, 2018
Dashboards
Power Query
Power Pivot
Pivot Tables Quick Start
August 11, 2023
Moderators
January 31, 2022
To build further on Velouria's solution for the daily pricing, I've added some helper formulas to your file (see attached) to facilitate the monthly pricing. I'm sure that you can condense it all into one formula with the LET function, but I haven't gone that far yet. Let's first see if this is really what you expect.
Trusted Members
Moderators
November 1, 2018
OK, there are almost certainly simpler formulas, but I think this works in G15 and copied across and down:
=LET(firststart,MAX($B15,G$12),firstend,MIN($C15,EOMONTH(G$12,0),G$13),numdays1,DAY(EOMONTH(G$12,0)),secondstart,firstend+1,secondend,MIN($C15,G$13),numdays2,DAY(EOMONTH(G$13,0)),result,MAX(0,firstend-firststart+1)*$D15/numdays1+MAX(0,secondend-secondstart+1)*$D15/numdays2,ROUND(result,2))
1 Guest(s)