Explanation

The choose function uses the first argument to “select” remaining elements. For example, in a scheme where 1 = small, 2 = medium, and 3 = large, this formula will “map” the number 2 to “medium”.

=CHOOSE(2,"small","medium","large")

In the case of fiscal quarters, we can use this same idea to map any incoming month (1-12) to one of 4 quarter values. We just need to use the MONTH function to get the month number as the first argument, then provide 12 numbers (one for each month of the year) that are carefully ordered to reflect the fiscal year desired:

=CHOOSE(MONTH(B5),1,1,1,2,2,2,3,3,3,4,4,4) // Jan start
=CHOOSE(MONTH(B5),4,4,4,1,1,1,2,2,2,3,3,3) // Apr start
=CHOOSE(MONTH(B5),3,3,3,4,4,4,1,1,1,2,2,2) // Jul start
=CHOOSE(MONTH(B5),2,2,2,3,3,3,4,4,4,1,1,1) // Oct start

Adding a Q and year

If you want the quarter number to include a “Q” with a year value, you can concatenate:

="Q"&CHOOSE(MONTH(date),1,1,1,2,2,2,3,3,3,4,4,4)&" - "&YEAR(date)

Will return values like: “Q1 - 2016”, “Q2 - 2016”, etc. This works for fiscal years with a January start. If the starting month is different from January, you can use an expression like this to calculate the fiscal year:

=YEAR(date)+(MONTH(date)>=startmonth)

This formula is explained in more detail here .

Explanation

In this example, the goal is to return the fiscal year for any given date, where a fiscal year starts in July as seen in the worksheet. By convention a fiscal year is denoted by the year in which it ends. So, if a fiscal year begins in July, then the date August 1, 2018 is in fiscal year 2019. The formula in D5, copied down, is:

=YEAR(B5)+(MONTH(B5)>=C5)

On the left, the YEAR function first returns the year from the date in B5:

=YEAR(B5) // returns 2017

To adjust this value to return the fiscal year for a July start, the following boolean expression is added to the year value:

+(MONTH(B5)>=C5) // returns zero

Here, the MONTH function returns the month from the date in B5 (1), and this result is compared to the start month in C5 (7). Since 1 is less than 7, the expression returns FALSE, which is evaluated by Excel as zero (0). The zero has no effect, so the final result is 2017. In cases where the month number for a date is greater than 7, this expression will return TRUE, which will be evaluated as 1 by Excel. This increments the year by one.

Note: with boolean logic , TRUE values are evaluated as 1 and FALSE values are evaluated as zero. Therefore, if the month from the date is greater than or equal to the start month, the expression returns TRUE, or 1. If not, the expression returns FALSE, or zero.