If Quarter is all you need, than this formula would probably cut it. In most cases, however, you'll need more than that:
- Fiscal period for October should be 01
- Fiscal YTD calculation needs to begin with October
- Fiscal QTD calculation needs to begin with the corresponding Quarter
For those purposes, I recommend calculating the difference in months between Jan 1 and Oct 1, and calculating a "Fiscal Date" for each one of the calendar Dates. Then, you can use regular Calendar functions, such as Quarter, InYearToDate, etc... for calculating the corresponding Fiscal attributes.