Checks if the day and month of a date fall within a date range
=AND(
OR(
DATE(YEAR(start_date), MONTH(date_to_check), DAY(date_to_check)) >= start_date,
DATE(YEAR(end_date), MONTH(date_to_check), DAY(date_to_check)) >= start_date
),
OR(
DATE(YEAR(start_date), MONTH(date_to_check), DAY(date_to_check)) <= end_date,
DATE(YEAR(end_date), MONTH(date_to_check), DAY(date_to_check)) <= end_date
)
)
This function checks if the month and day of a date fall within a date range, regardless of the year. It's ideal for tracking events like anniversaries or yearly deadlines that recur on the same day. For example, to see if March 1st is between November 1, 2024, and December 31, 2024, you would use "=YEARLESS_DATE_IN_RANGE(A1, B1, C1)", where A1 holds March 1st, B1 is November 1, 2024, and C1 is December 31, 2024. This function ensures that annual events are recognized even when they span different years.
Use the inputs below to create YEARLESS_DATE_IN_RANGE as a reusable custom function in Google Sheets.
Learn how to add custom functions to Google SheetsYEARLESS_DATE_IN_RANGE
Checks if the day and month of a date fall within a date range
=AND( OR( DATE(YEAR(start_date), MONTH(date_to_check), DAY(date_to_check)) >= start_date, DATE(YEAR(end_date), MONTH(date_to_check), DAY(date_to_check)) >= start_date ), OR( DATE(YEAR(start_date), MONTH(date_to_check), DAY(date_to_check)) <= end_date, DATE(YEAR(end_date), MONTH(date_to_check), DAY(date_to_check)) <= end_date ) )
date_to_check
start_date
end_date
The original date being checked
A1
The start date of the period within which the date is checked.
B1
The end date of the period within which the date is checked.
C1
Other functions in the same category: Date & Time Operations
Determine if a date falls within a start and end date
Counts occurrences of a weekday between two dates
Returns TRUE if two date ranges overlap
Returns TRUE if a date falls on Monday through Friday
Returns TRUE if a date falls on Saturday or Sunday
Return the next date that matches a weekday number
Named functions enable the creation of custom, reusable formulas that mimic built-in functions, streamlining calculations and data manipulations. These functions simplify complex formulas, making spreadsheets more readable and less prone to errors. By encapsulating intricate logic within a single function call, they enhance consistency across your data. Utilizing named functions reduces the need to write lengthy formulas repeatedly, thereby improving workflow efficiency and productivity in data analysis and management.
Download and import — fastest way to add the function but does not include argument descriptions and examples
Follow these simple steps to download and import a function into your spreadsheet. This method is the quickest and easiest way to add the named function to your Google Sheets document, but will not include the argument description and examples.
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.
Copy and paste — copy and paste each property one at a time
Follow these simple steps to integrate a custom named function into your spreadsheet:
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.