To calculate the number of weeks between two dates in Excel, the fastest method is to subtract the start date from the end date and divide the result by 7: =(End_Date - Start_Date)/7. Because Excel stores dates as sequential serial numbers, subtracting one from another gives you the total number of days, which can then be converted into weeks through simple division. Depending on whether you need a decimal for partial weeks, a rounded whole number, or only full completed weeks, you may need to wrap this formula in functions like ROUND, INT, or DATEDIF.
What You'll Need
- A computer with Microsoft Excel installed (any version from 2007 to the current Microsoft 365 version).
- A dataset containing at least two columns of dates: a start date and an end date.
- Dates must be formatted as "Date" cells, not as "Text," for the math to function correctly.
Step-by-Step
Method 1: The Basic Division Formula (For Decimals)
Use this method if you need to know exactly how many weeks have passed, including fractions of a week (e.g., 4.28 weeks).
- Open your Excel spreadsheet and ensure your start date is in one cell (e.g., A2) and your end date is in another (e.g., B2).
- Click on the cell where you want the result to appear (e.g., C2).
- Type the following formula:
=(B2-A2)/7. - Press Enter.
- If the result looks like a date (e.g., January 7, 1900), go to the Home tab, locate the Number group, and change the dropdown menu from "Date" to "General" or "Number".
Method 2: Using the INT Function (For Full Completed Weeks)
Use this method if you only care about how many 7-day periods have fully elapsed, ignoring any remaining days.
- Select the cell for your result.
- Enter the formula:
=INT((B2-A2)/7). - The
INTfunction rounds the number down to the nearest integer, effectively stripping away the decimal. - Press Enter. This will give you a whole number representing completed weeks.
Method 3: Using the DATEDIF Function (The Hidden Tool)
The DATEDIF function is a "compatibility" function in Excel. It doesn't appear in the autocomplete list when you type it, but it is highly powerful for calculating differences between dates.
- Select your result cell.
- Type the formula:
=DATEDIF(A2, B2, "d")/7. - In this formula,
"d"tells Excel to calculate the total number of days between the two dates. - Dividing that total by 7 converts it to weeks.
- If you want this result rounded, you can wrap it in
ROUND, for example:=ROUND(DATEDIF(A2, B2, "d")/7, 1)to keep one decimal place.
Method 4: Using the ROUND Function (For Standard Rounding)
If you want 4.6 weeks to show as 5 weeks and 4.2 weeks to show as 4 weeks, use the ROUND function.
- Select your result cell.
- Type the formula:
=ROUND((B2-A2)/7, 0). - The
0at the end tells Excel to round to zero decimal places. - Press Enter.
Common Mistakes
The most frequent error when calculating weeks is failing to use parentheses. If you type =B2-A2/7, Excel follows the order of operations (BODMAS/PEMDAS) and will divide A2 by 7 first, then subtract that result from B2. This will lead to a massive, incorrect number. Always enclose the subtraction in parentheses: (B2-A2).
Another common mistake is the "Date Format Bug." When you perform a calculation on two date cells, Excel often assumes you want the answer to be a date as well. If your result is something like "January 5, 1900," it is not an error in your math; it is simply a formatting issue. You must change the cell format to "General" or "Number" to see the actual count of weeks.
Users also frequently swap the start and end dates. If you put the earlier date second (e.g., = (Start_Date - End_Date)/7), you will get a negative number. While mathematically correct, it is usually not the desired outcome for a project timeline or age calculation.
Tips
To make your spreadsheet more dynamic, use a cell reference for the current date. Instead of typing today's date manually, use the TODAY() function. For example, =(TODAY()-A2)/7 will tell you how many weeks have passed from a specific date in A2 up until today, and it will update automatically every time you open the file.
If you are working with a very large dataset, avoid calculating the weeks in a separate column if you only need the total. You can use the SUMPRODUCT function to calculate the total weeks across multiple rows without needing helper columns, though this is an advanced technique and usually unnecessary for basic tracking.
For visual clarity, use Conditional Formatting on your results. For example, you can set a rule that highlights the cell in red if the number of weeks exceeds a certain threshold (e.g., > 12), which is useful for tracking overdue tasks or aging invoices.
Troubleshooting
If your formula returns a #VALUE! error, it almost always means that one of the cells you are referencing is not actually a date. Excel cannot perform subtraction on text. To check this, use the =ISNUMBER(A2) formula. If it returns FALSE, your date is being stored as text. To fix this, select the column, go to the Data tab, select Text to Columns, and click Finish. This often forces Excel to re-evaluate the text as dates.
If you see a #NUM! error when using DATEDIF, it is usually because the start date is later than the end date. DATEDIF cannot handle negative time intervals. Ensure the first date in the formula is the oldest date and the second date is the most recent.
If the result is slightly off (e.g., you expect 4 weeks but get 3.85), check if your dates include timestamps. If your cells contain both a date and a time (e.g., 2023-01-01 14:00), the subtraction will include those fractions of a day. To ignore the time and only count the dates, wrap your cell references in the INT function: =(INT(B2)-INT(A2))/7.
Frequently Asked Questions
Can I calculate work weeks (excluding weekends)?
Yes, but not with simple division. Use the NETWORKDAYS function to find the number of working days between two dates, then divide that result by 5: =NETWORKDAYS(A2, B2)/5.
How do I show weeks and days together (e.g., 4 weeks, 2 days)?
You can combine two formulas using the ampersand (&) symbol. Use =INT((B2-A2)/7) & " weeks, " & MOD(B2-A2, 7) & " days". The MOD function finds the remainder after dividing by 7.
Does the formula change if I use Google Sheets?
No, these formulas are identical in Google Sheets. Both programs treat dates as serial numbers and support INT, ROUND, and DATEDIF.
Why is my DATEDIF formula not showing up in the suggestions?
DATEDIF is a legacy function kept for compatibility with Lotus 1-2-3. Microsoft does not list it in the formula autocomplete, but it still works perfectly if you type the full name and open the parenthesis.
How do I calculate weeks remaining until a future deadline?
Use the same division formula, but put the future date first: =(Deadline_Date - TODAY())/7. This will give you a countdown in weeks.