Calculates the difference between two dates in whole weeks.
=INT(DATEDIF(start_date, end_date, "D") / 7)The "DATE_DIF_WEEKS" function calculates the number of full weeks between two dates. To use this function, input the start date into one cell (e.g., "A2") and the end date into another cell (e.g., "B2"). Then, apply the formula "=DATE_DIF_WEEKS(A2,B2)" in any cell to get the difference in full weeks. This method provides a simple way to measure time spans in weekly increments.
Use the inputs below to create DATEDIF_WEEKS as a reusable custom function in Google Sheets.
Learn how to add custom functions to Google SheetsDATEDIF_WEEKS
Calculates the difference between two dates in whole weeks.
=INT(DATEDIF(start_date, end_date, "D") / 7)
start_date
end_date
This is the starting date of your period.
A2
This is the ending date of your period.
B2
Other functions in the same category: Date & Time Operations
Determine if a date falls within a start and end date
Returns TRUE if two date ranges overlap
Converts a time duration in minutes to a readable format (e.g., 1 hr 30 min)
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.