IsDateWithinRange

# Is a date within range of dates

## Financial year 2017 - example

Does a particular date fall within the financial year 2017? In other words, is the date in the range 1 July 2016 to 30 June 2017?

Code 1: Function FY_17 determines whether date falls in Australian financial year 2017, and returns Boolean TRUE
Public Function FY_17(Dte As Date) As Boolean
' In Australia, the financial (fiscal) year runs from 1 July to 30 June
' - the financial year is normally denoted by the year in which it ends
' - for example, the period 1 July 2016 to 30 June 2017 is denoted by FY2017 or FY17

If Dte >= DateValue("1 July 2016") And Dte <= DateValue("30 June 2017") Then
FY_17 = True
Else
FY_17 = False
End If

End Function


About code 1 :

• Line 6: logic [1 Jul 16] <= Dte <= [30 Jun 17]. The code contains two logical tests Dte >= DateValue("1 July 2016") and Dte <= DateValue("30 June 2017"), and returns TRUE if both tests are TRUE

• This example was developed in Excel 2016 Pro 64 bit.
• Revised: Wednesday 26th of October 2016 - 03:30 AM, Pacific Time (PT)