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. The basic formula is =(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 by dividing by the number of days in a week.

What You'll Need

  • A computer with Microsoft Excel installed (any version from 2010 onwards).
  • A dataset containing at least two columns of dates (a start date and an end date).
  • Dates formatted correctly as "Date" cells rather than "Text" cells.

Step-by-Step

  1. Prepare Your Data: Enter your start date in one cell (e.g., cell A2) and your end date in another cell (e.g., cell 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; it should say "Date".
  2. Select the Result Cell: Click on the cell where you want the number of weeks to appear (e.g., cell C2).
  3. Enter the Basic Subtraction Formula: Type =B2-A2 and press Enter. This will give you the total number of days between the two dates. If the result looks like a weird date (e.g., January 15, 1900), change the cell format to "General" or "Number" using the dropdown menu in the "Home" tab.
  4. Convert Days to Weeks: To turn those days into weeks, modify the formula to divide by 7. Type =(B2-A2)/7 into cell C2 and press Enter. The parentheses are critical here because of the order of operations; Excel must subtract the dates before it divides by seven.
  5. Handle Decimals (Optional): If the dates do not fall exactly seven days apart, you will see a decimal (e.g., 4.28 weeks). Depending on your needs, you can handle this in three ways:
    • For exact decimals: Leave the formula as is.
    • To round down to the nearest whole week: Use the INT function. Change the formula to =INT((B2-A2)/7). This removes the remainder and tells you how many full weeks have passed.
    • To round up to the nearest whole week: Use the ROUNDUP function. Change the formula to =ROUNDUP((B2-A2)/7, 0). This is useful if any part of a week counts as a full week for billing or project tracking.
  6. Apply to Multiple Rows: Once the formula is working in cell C2, hover your mouse over the bottom-right corner of the cell until a small black cross (the fill handle) appears. Click and drag this handle down to apply the calculation to all other rows in your dataset.

Common Mistakes

One of the most frequent errors is forgetting the parentheses in the formula. If you type =B2-A2/7, Excel follows the mathematical order of operations (BODMAS/PEMDAS), meaning it will divide the end date by 7 first and then subtract that result from the start date. This will result in a massive, nonsensical number. Always wrap the subtraction in parentheses: (B2-A2).

Another common mistake is the "Date Format Bug." When you subtract two dates, Excel sometimes assumes you want the result to also be a date. If your result is something like "January 5, 1900" instead of "5", it is because Excel is treating the number 5 as the 5th day of its internal calendar. To fix this, go to the Home tab, find the Number Format dropdown, and change it from "Date" to "General" or "Number".

Users also often confuse the DATEDIF function with simple subtraction. While =DATEDIF(A2, B2, "d") calculates days, there is no "w" argument for weeks in the DATEDIF function. Attempting to use =DATEDIF(A2, B2, "w") will result in a #VALUE! error. You must calculate days first and then divide by 7.

Tips

If you need to calculate the number of weeks from a specific date until today, you can use the TODAY() function. Instead of referencing a cell for the end date, use =(TODAY()-A2)/7. This formula is dynamic, meaning every time you open the spreadsheet, the week count will update automatically based on the current calendar date.

For those who need to display the result as a string of text (e.g., "4 Weeks and 2 Days"), you can combine the INT and MOD functions. Use the following formula: =INT((B2-A2)/7) & " Weeks and " & MOD(B2-A2, 7) & " Days". The INT part calculates the full weeks, and the MOD function finds the remainder of days left over after the weeks are accounted for.

To keep your spreadsheet clean, consider using "Named Ranges". Instead of using cell references like A2 and B2, you can highlight your start date column and name it "StartDate" in the Name Box (top left). Your formula then becomes =(EndDate-StartDate)/7, which is much easier to read and audit months later.

Troubleshooting

If your formula returns a #VALUE! error, the most likely cause is that one of your dates is not actually stored as a date. This often happens when importing data from CSV files or other software where dates are stored as text. To test this, use the =ISNUMBER(A2) formula. If it returns FALSE, Excel doesn't recognize the cell as a date. To fix this, select the column, go to the "Data" tab, select "Text to Columns", click "Next" twice, and on the third step, select "Date" and choose the correct format (e.g., MDY) before clicking "Finish".

If you are getting a #NUM! error, check to see if your start date is later than your end date. Simple subtraction will result in a negative number. While this is mathematically correct, some advanced functions (like DATEDIF) cannot handle negative intervals and will throw an error. If you want the absolute number of weeks regardless of which date comes first, wrap your formula in the ABS function: =ABS((B2-A2)/7).

If the result is simply 0 when you know there are several days between the dates, check your cell decimal settings. If the cell is formatted as a whole number, a result of 0.8 weeks will be rounded down to 0. Increase the decimal places using the "Increase Decimal" button in the Home tab to see the precise calculation.

Frequently Asked Questions

Can I calculate work weeks (excluding weekends)?

Yes, but you cannot use simple subtraction. You must use the NETWORKDAYS function to find the total working days first, then divide by 5 (the number of working days in a week). The formula would be =NETWORKDAYS(A2, B2)/5.

How do I calculate weeks from a date to the end of the year?

Use the DATE function to create the end-of-year target. For example, =(DATE(YEAR(A2), 12, 31)-A2)/7. This takes the year of your start date and sets the end point to December 31st of that same year.

Does Excel have a built-in "WEEK" function for durations?

No. Excel has WEEKNUM and WEEKDAY, but these identify which week of the year a date falls in or which day of the week it is. They do not calculate the duration between two dates.

What is the difference between using INT and ROUND?

INT always rounds down to the nearest integer, which is ideal for "completed weeks." ROUND follows standard math rules (rounding .5 up), and ROUNDUP always moves to the next whole number, which is better for "any part of a week counts as a full week."

Why is my formula returning a date like 01/07/1900?

This happens because Excel thinks the result of your subtraction should be a date. Since the result is a small number (like 7), Excel displays the 7th day of its calendar. Change the cell format to "General" to see the actual number.