To find 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, use the formula =(B2-A2)/7. This works because Excel stores dates as sequential serial numbers, meaning the difference between two dates is the total number of days.
Depending on whether you need a decimal for partial weeks or a whole number for completed weeks, you may need to wrap this calculation in a rounding function. This guide covers the basic subtraction method, the DATEDIF function for more control, and how to handle rounding for professional reporting.
What You'll Need
- Microsoft Excel (any version)
- A dataset containing at least two columns of dates (Start Date and End Date)
- Dates formatted as "Date" in the cell properties to ensure the formula calculates correctly
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 that both cells are formatted as Dates. You can check this by selecting the cells and looking at the "Number" group on the Home tab.
- Enter the Basic Formula: Click on the cell where you want the result to appear (e.g., C2). Type the following formula:
=(B2-A2)/7. - Apply the Calculation: Press Enter. If the result looks like a date (e.g., 1/7/1900), it is because Excel automatically applied date formatting to the result cell. To fix this, go to the Home tab, find the "Number" dropdown menu, and change the format to General or Number.
- Handle Partial Weeks (Rounding):
- For exact decimals: Keep the formula as is. A result of 2.42 means 2 weeks and roughly 3 days.
- For completed weeks only: Use the INT function to strip the decimals. Formula:
=INT((B2-A2)/7). This tells you how many full 7-day periods have passed. - To round up to the nearest week: Use the ROUNDUP function. Formula:
=ROUNDUP((B2-A2)/7, 0). This is useful for billing or project timelines where any part of a week counts as a full week.
- Using the DATEDIF Method (Alternative): If you prefer a dedicated date function, use
=DATEDIF(A2, B2, "d")/7. The "d" tells Excel to find the difference in days, which you then divide by 7 to get weeks. - Drag to Fill: Hover your mouse over the bottom-right corner of the result cell until a small black cross (the fill handle) appears. Click and drag down to apply the formula to all other rows in your dataset.
Common Mistakes
- Incorrect Cell Formatting: The most common error is the result cell appearing as a date instead of a number. Always ensure the output cell is set to "General" or "Number" format.
- Wrong Order of Subtraction: If you subtract the end date from the start date (A2-B2), you will get a negative number. Always subtract the earlier date from the later date.
- Missing Parentheses: Writing
=B2-A2/7without parentheses will result in a wrong answer. Because of the order of operations (BODMAS/PEMDAS), Excel will divide A2 by 7 first and then subtract that from B2. You must wrap the subtraction in parentheses:=(B2-A2)/7. - Using Text instead of Dates: If your dates are typed as text (e.g., "Jan 1st, 2023") and not recognized as date values by Excel, the formula will return a #VALUE! error.
Tips
- Calculate from Today: If you want to know how many weeks have passed from a date until today, use the TODAY function. Formula:
=(TODAY()-A2)/7. This formula will update automatically every time you open the spreadsheet. - Adding "Weeks" Label: To make your sheet more readable, you can add a text label to the result using concatenation. Formula:
=INT((B2-A2)/7) & " Weeks". Note that this converts the result into text, meaning you cannot use that cell in further mathematical calculations. - Using Conditional Formatting: If you are tracking deadlines, use Conditional Formatting on your "Weeks" column to highlight cells in red if the number of weeks exceeds a certain threshold.
Troubleshooting
If your formula is not working as expected, try these steps in order:
- Check for #VALUE! Errors: This usually means one of your date cells contains text or a space that Excel cannot read as a number. Select your date columns and use the "Find and Replace" tool to remove any non-date characters.
- Verify Date Recognition: To see if Excel recognizes your date, change the cell format to "Number". If the date changes to a five-digit number (like 45285), it is a valid Excel date. If it stays exactly as it was, it is stored as text.
- Check for Hidden Rows/Filters: If you are dragging the formula down and some cells are skipping, ensure you don't have a filter active that is hiding rows.
- Check for Circular References: Ensure your formula is not placed in cell A2 or B2. If the formula refers to its own cell, it will create a circular reference error and return 0.
Frequently Asked Questions
How do I calculate weeks and remaining days?
To show both, use =INT((B2-A2)/7) & " weeks, " & MOD(B2-A2, 7) & " days". The INT function handles the full weeks, and the MOD function finds the remainder of days.
Can I calculate work weeks (excluding weekends)?
Yes, but you cannot simply divide by 7. Use the NETWORKDAYS function to get the number of working days, then divide by 5. Formula: =NETWORKDAYS(A2, B2)/5.
Why does my formula show a date like 1/0/1900?
This happens because the cell is formatted as a "Date." Excel thinks the number (e.g., 1.42) is a date serial number. Change the cell format to "General" or "Number" via the Home tab.
Does this formula work in Google Sheets?
Yes, the logic and formulas =(B2-A2)/7 and DATEDIF are identical in both Microsoft Excel and Google Sheets.
How do I count weeks from a date to the end of the current year?
Use the DATE function for the end of the year. Formula: =(DATE(YEAR(TODAY()), 12, 31)-A2)/7.