Calculate financial year

If my variable stores value out_strBillPeriod =jul 2021…that means value vary monthly in format MMM yyyy…so how I can calculate financial year according to this value?

Want output in this format 2021-2022

Financial year start from April…

so I want if the input is Jun 2021…output . 2021-2022
And if month is before April i.e Mar 2021 …output . 2020-2021

you can convert the string in to a date then simply check the month number, if it is greater than 4 (april) then you can take the year as it is and add the last two digit of its incremented value after a -
If it is less than you can decrement the year and add the current years’ last two digit after -


give a try on:


Jan=1, Feb=2… Apr=4… for the intFYStartDate


BillDate = CDate("jul 2021")
Offset = Convert.ToInt32( intFYStartDate <= BillDate.Month  )
strPeriod = String.Format("{0}-{1}", BillDate.Year-Offset,BillDate.Year-Offset+1)

Result Testseries: