VBA script for having a fiscal year and finding the months between the start and end date

dandanwrld

New Member
Joined
May 17, 2023
Messages
1
Office Version
  1. 2013
Platform
  1. Windows
I need help figuring a vba script that has a fiscal year from November 1 to October 31 the next year. I need to find the amount of months within the fiscal year from the start date and end date. For example. If the start date is April 15 2021 and the end date is April 15 2023, then the amount of months would be 6.5 because it is 6.5 months from the end date and then 5.5 months from start date.

Sorry if my wording is confusing.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
If I understand what you need you can use worksheet formulas to do it. Here is a portion of a worksheet.

MonthsUntilOrAfter.xlsx
CDEFGHIJKLMNO
1Fiscal Year
2StartEnd
311/1/202210/31/2023
4
5Start Date4/15/202118.56Months until 11/1/2022
6
7End Date4/15/20235.42Months after 10/31/2023
86.54Months until 10/31/2023
9Months11.96
10
11JanFebMarAprMayJunJulAugSepOctNovDecAverage days
123128.253130313031313031303130.4375
Sheet1
Cell Formulas
RangeFormula
E5E5=(C3-D5)/30.434
F5F5="Months until " & TEXT(C3, "m/d/yyyy")
F7F7="Months after " & TEXT(D3, "m/d/yyyy")
F8F8="Months until " & TEXT(D3, "m/d/yyyy")
E7E7=(D7-C3)/30.434
E8E8=(D3-D7)/30.44
E9E9=SUM(E7:E8)
O12O12=AVERAGE(C12:N12)
 
Upvote 0
The previous post had an error. Here is a correct one.

MonthsUntilOrAfter.xlsx
CDEFGHIJKLMNO
1Fiscal Year
2StartEnd
311/1/202210/31/2023
4
5Start Date4/15/202118.56Months until 11/1/2022
6
7End Date4/15/20235.42Months after 11/1/2022
86.54Months until 10/31/2023
9Months11.96
10Average days
11JanFebMarAprMayJunJulAugSepOctNovDecin a month
123128.253130313031313031303130.4375
Sheet1
Cell Formulas
RangeFormula
E5E5=(C3-D5)/30.434
F5F5="Months until " & TEXT(C3, "m/d/yyyy")
F7F7="Months after " & TEXT(C3, "m/d/yyyy")
F8F8="Months until " & TEXT(D3, "m/d/yyyy")
E7E7=(D7-C3)/30.434
E8E8=(D3-D7)/30.44
E9E9=SUM(E7:E8)
O12O12=AVERAGE(C12:N12)
 
Upvote 0

Forum statistics

Threads
1,224,825
Messages
6,181,190
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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