Amounts distributed by months based on two dates.

KasperSSI

New Member
Joined
Nov 28, 2019
Messages
26
Office Version
  1. 365
Platform
  1. Windows
Hi,

Working an a budget template. And i want to make a formula that splites the amount into the correct months based on dates.
Currently i have following that works if the two dates are in 2025. but marked line with end date in 2026 is giving me problems.
Should give me 50.000 from july to December.

=IF(AND(Q$36>=MONTH($G39);$J$35>=YEAR($G39);Q$36<=MONTH($H39);$J$35<=YEAR($H39));$J39/(DATEDIF($G39;$H39;"M")+1);"")
1729862479310.png


Looking forward to your solution suggestions :)
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
How about:

Excel Formula:
=LET(b, J39,
m, VALUE(UNIQUE(TEXT(SEQUENCE(H39-G39+1, ,G39), "mm-yyyy"))),
fm, TAKE(m, 1),
lm, TAKE(m,-1),
amountPerMonth, b/ROWS(m),
monthSeq, DATE($J$35, SEQUENCE(, 12), 1),
IFERROR(IF((monthSeq>=fm)*(monthSeq<=lm), amountPerMonth, ""), "")
)

I count 11 month for row 39, so the distributed budged would be 45,454.55 per month not 50.000. Is that correct?

1729869030280.png
 
Last edited:
Upvote 0
Instead of entering the year and month, enter the full date and then change the cell format:
In cells K34, K35 and K36 I have the same date 1/Jan/2025 but the cell format is different, in the first cell the custom format is "M", for the second cell it is "MMM" and the third is "DD/MM/YYYY"

varios 25oct2024.xlsm
FGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAI
341234567891011121234567891011121
352025enefebmarabrmayjunjulagosepoctnovdicenefebmarabrmayjunjulagosepoctnovdicene
36MargStart DateEnd DateCostBud01/01/202501/02/202501/03/202501/04/202501/05/202501/06/202501/07/202501/08/202501/09/202501/10/202501/11/202501/12/202501/01/202601/02/202601/03/202601/04/202601/05/202601/06/202601/07/202601/08/202601/09/202601/10/202601/11/202601/12/202601/01/2027
3701/05/202531/10/202550,000.00    8,333.338,333.338,333.338,333.338,333.338,333.33               
3801/04/202530/06/20255,000.00   1,666.671,666.671,666.67                   
3905/07/202525/05/2026500,000.00      45,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.55        
4006/01/202530/06/20255,000,000.00833,333.33833,333.33833,333.33833,333.33833,333.33833,333.33                   
4107/01/202501/01/202748,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.00
Hoja2
Cell Formulas
RangeFormula
K37:AI41K37=IF(AND(K$36>=EOMONTH($G37,-1)+1,K$36<=$H37),$J37/(DATEDIF($G37,$H37,"M")+1),"")


🤗
 
Upvote 0
Solution
Instead of entering the year and month, enter the full date and then change the cell format:
In cells K34, K35 and K36 I have the same date 1/Jan/2025 but the cell format is different, in the first cell the custom format is "M", for the second cell it is "MMM" and the third is "DD/MM/YYYY"

varios 25oct2024.xlsm
FGHIJKLMNOPQRSTUVWXYZAAABACADAEAFAGAHAI
341234567891011121234567891011121
352025enefebmarabrmayjunjulagosepoctnovdicenefebmarabrmayjunjulagosepoctnovdicene
36MargStart DateEnd DateCostBud01/01/202501/02/202501/03/202501/04/202501/05/202501/06/202501/07/202501/08/202501/09/202501/10/202501/11/202501/12/202501/01/202601/02/202601/03/202601/04/202601/05/202601/06/202601/07/202601/08/202601/09/202601/10/202601/11/202601/12/202601/01/2027
3701/05/202531/10/202550,000.00    8,333.338,333.338,333.338,333.338,333.338,333.33               
3801/04/202530/06/20255,000.00   1,666.671,666.671,666.67                   
3905/07/202525/05/2026500,000.00      45,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.5545,454.55        
4006/01/202530/06/20255,000,000.00833,333.33833,333.33833,333.33833,333.33833,333.33833,333.33                   
4107/01/202501/01/202748,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.002,000.00
Hoja2
Cell Formulas
RangeFormula
K37:AI41K37=IF(AND(K$36>=EOMONTH($G37,-1)+1,K$36<=$H37),$J37/(DATEDIF($G37,$H37,"M")+1),"")


🤗
Thanks - Got it by changing the date format☺️
 
Upvote 0
Thanks - Got it by changing the date format☺️
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
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