To calculate the number of weeks between two dates in Excel, subtract the start date from the end date and divide the result by 7. For example, if your start date is in cell A2 and your end date is in cell B2, the formula is =(B2-A2)/7. This works because Excel stores dates as sequential serial numbers, meaning a difference of 1 equals one day.
What You'll Need
- A computer with Microsoft Excel installed (any version from 2007 onwards).
- A dataset containing at least two columns of dates (a start date and an end date).
- Basic knowledge of how to enter a formula into a cell.
Step-by-Step
- Prepare Your Data: Enter your start date in one cell (e.g., A2) and your end date in another cell (e.g., B2). Ensure these cells are formatted as "Date" by selecting the cells, going to the Home tab, and choosing "Short Date" from the Number format dropdown menu.
- Select the Result Cell: Click on the cell where you want the number of weeks to appear (e.g., C2).
- Enter the Basic Formula: Type
=(B2-A2)/7into the cell. The parentheses are critical here; they force Excel to calculate the total number of days first before dividing by 7. If you omit them, Excel will follow the order of operations (division before subtraction), leading to an incorrect result. - Press Enter: Once you hit Enter, Excel will display the number of weeks. If the result shows as a date (e.g., January 7, 1900), you must change the cell format. Go to the Home tab, click the Number format dropdown, and select "General" or "Number".
- Handle Decimals (Optional): If the dates do not fall exactly on the same day of the week, you will see a decimal (e.g., 4.28 weeks). To handle this, you can use different rounding functions:
- For exact decimals: Leave the formula as is.
- To round down to the nearest whole week: Use
=INT((B2-A2)/7). This removes the decimal entirely, showing only completed weeks. - To round to two decimal places: Use
=ROUND((B2-A2)/7, 2). - To round up to the nearest whole week: Use
=ROUNDUP((B2-A2)/7, 0).
- Apply to Multiple Rows: If you have a long list of dates, click the small green square (fill handle) at the bottom-right corner of cell C2 and drag it down to the end of your data range. Excel will automatically adjust the cell references (A3, B3, etc.) for each row.
Common Mistakes
One of the most frequent errors is the Formatting Trap. Because you are performing a calculation involving dates, Excel often assumes the result should also be a date. When you see a weird date like "January 5, 1900" instead of the number "5", it is because Excel is interpreting the number 5 as the 5th day since its epoch date. Always ensure your result cell is set to "General" or "Number".
Another common mistake is Incorrect Order of Subtraction. In Excel, dates are numbers that increase as time moves forward. If you subtract the end date from the start date (e.g., =(A2-B2)/7), you will get a negative number. Always subtract the older date (start) from the newer date (end).
Users also frequently forget the parentheses. Writing =B2-A2/7 tells Excel to divide cell A2 by 7 first, and then subtract that result from B2. This will result in a massive, nonsensical number. The parentheses (B2-A2) ensure the day-count is established before the week-conversion happens.
Tips
Using the DATEDIF Function: While the subtraction method is easiest, you can use the hidden DATEDIF function for more control. To get total days and then divide, use =DATEDIF(A2, B2, "d")/7. This function is not listed in the standard Excel formula autocomplete, but it works in all versions. It is particularly useful if you want to ensure only full days are counted.
Calculating Work-Weeks: If you only care about business weeks (excluding weekends), the standard division by 7 won't work. Instead, use the NETWORKDAYS function to find the number of working days and divide by 5: =NETWORKDAYS(A2, B2)/5. This is ideal for project management and payroll tracking.
Dynamic Dates: If you want to calculate the number of weeks from a specific date until today, replace the end date cell reference with the TODAY() function. For example: =(TODAY()-A2)/7. This formula will update automatically every time you open the spreadsheet.
Troubleshooting
The result is #VALUE!: This error usually means one of your date cells contains text instead of a valid date. Check for trailing spaces, typos (like 13/32/2023), or dates entered as text strings that Excel doesn't recognize. To fix this, select your date columns, go to the Data tab, select "Text to Columns", and click "Finish" to force Excel to re-evaluate the data types.
The result is #NUM!: This typically happens if you are using DATEDIF and the start date is actually after the end date. Ensure your chronological order is correct: Start Date first, End Date second.
The formula isn't calculating, it's just showing the text: This happens if the cell was formatted as "Text" before you typed the formula. Change the cell format to "General", then click into the formula bar and press Enter again to trigger the calculation.
The number of weeks seems off by one: This is often a logic choice rather than a formula error. Standard subtraction calculates the difference. If you want to include the start day as "Day 1" (inclusive counting), you must add 1 to the day count: =((B2-A2)+1)/7. This is common in rental agreements or employment contracts where the first day counts as a full day of activity.
Frequently Asked Questions
Can I calculate weeks and remaining days separately?
Yes. To get the whole number of weeks, use =INT((B2-A2)/7). To find the remaining days left over, use the MOD function: =MOD(B2-A2, 7). This will tell you, for example, that the duration is "4 weeks and 3 days".
Does this work for dates in different years?
Yes. Excel's serial date system handles leap years and varying month lengths automatically. Whether the dates are two days apart or twenty years apart, the subtraction method remains accurate.
How do I calculate weeks between two dates in Google Sheets?
The process is identical. Google Sheets uses the same date-as-number logic, so =(B2-A2)/7 works exactly the same way as it does in Microsoft Excel.
What is the best way to display the result as "X Weeks"?
Instead of typing "Weeks" into the cell (which would turn it into text and break future calculations), use Custom Formatting. Right-click the cell, select "Format Cells", go to the "Number" tab, select "Custom", and in the Type box, enter 0.00 "Weeks". This keeps the value as a number but displays the label.
Why does my formula return a negative number?
This occurs because the date in the first part of your subtraction is smaller (earlier) than the date being subtracted. To fix this, ensure your formula follows the structure =(End_Date - Start_Date)/7.