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 =DateInRange(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.
Function name: DATE_IN_RANGE
Function description: Checks if the day and month of a date fall within a date range
Argument placeholders: date_to_check, start_date, end_date
Formula definition: =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 ) )
Argument description (date_to_check): The original date being checked
Argument example (date_to_check): A1
Argument description (start_date): The start date of the period within which we're checking if the date falls.
Argument example (start_date): B1
Argument description (end_date): The end date of the period within which we're checking if the date falls.
Argument example (end_date): C1
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.
Follow these simple steps to download and import the 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.
Follow these simple steps to integrate the 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.
Copyright © 2024 Keshia Rose. All rights reserved for website content. Individual functions are available under an MIT License.
This site is not associated with or endorsed by Google.