Yes, you can calculate the number of weeks between two dates in Excel using a simple formula: =(B1-A1)/7, where A1 is the start date and B1 is the end date. This gives you the total weeks as a decimal. To get a whole number, use =INT((B1-A1)/7) for full weeks or =ROUND((B1-A1)/7,0) to round to the nearest week. This guide covers all the common variations, including counting weekdays only and handling dates in different cells or rows.
What You'll Need
- A computer with Microsoft Excel (2010 or later, including Microsoft 365) or a compatible spreadsheet app like Google Sheets (the formulas are identical).
- Two cells containing valid dates. In Excel, a date is just a number formatted to look like a date, so make sure the cells are formatted as Date, not Text.
- Basic familiarity with entering formulas (starting with an equals sign).
Step-by-Step
Method 1: Total Weeks (Decimal)
- Open your Excel workbook and locate the start date and end date. For this example, assume the start date is in cell A1 and the end date is in cell B1.
- Click on an empty cell where you want the result to appear, for example C1.
- Type the formula:
=(B1-A1)/7 - Press Enter. Excel subtracts the start date from the end date to get the number of days, then divides by 7 to convert to weeks. The result will be a decimal, like 3.428571 for 24 days.
- To format the result as a number with a reasonable number of decimal places, right-click the cell, choose Format Cells, select Number, and set Decimal places to 2 (or 1).
Method 2: Whole Weeks (Truncated)
- If you only want the number of complete weeks (e.g., 3 weeks for 24 days, ignoring the extra 3 days), use the INT function.
- In a new cell, type:
=INT((B1-A1)/7) - Press Enter. The INT function rounds down to the nearest integer. For 24 days, this gives 3.
- Note: This does not round; it always truncates. If you need rounding to the nearest week, use the next method.
Method 3: Round to Nearest Week
- To round the decimal weeks to the nearest whole number, use the ROUND function.
- Type:
=ROUND((B1-A1)/7,0) - Press Enter. For 24 days, the decimal is 3.428, so ROUND gives 3. For 26 days (3.714 weeks), it gives 4.
- If you want to round up always (ceiling), use
=CEILING((B1-A1)/7,1). This gives 4 for 24 days.
Method 4: Weeks and Days (Text Result)
- If you want a readable result like "3 weeks and 3 days", combine the INT and MOD functions.
- Type:
=INT((B1-A1)/7) & " weeks and " & MOD(B1-A1,7) & " days" - Press Enter. The MOD function returns the remainder after dividing the days by 7. For 24 days, this gives "3 weeks and 3 days".
- Make sure the cell is formatted as General (not Date), otherwise Excel might display the text as a date.
Method 5: Whole Weeks Between Two Dates (DATEDIF)
- Excel has a hidden DATEDIF function that can calculate the number of complete weeks.
- Type:
=DATEDIF(A1,B1,"d")/7gives the same decimal as Method 1. - For whole weeks, use:
=INT(DATEDIF(A1,B1,"d")/7)or simply=DATEDIF(A1,B1,"w")– note that DATEDIF does not have a "w" unit in many versions, so the "d"/7 approach is safer. - DATEDIF is not listed in Excel's function wizard, but it works in all modern versions. If it returns a #NUM! error, check that the start date is before the end date.
Method 6: Weekdays Only (Business Weeks)
- If you need to count only weekdays (Monday–Friday) between two dates, use the NETWORKDAYS function.
- Type:
=NETWORKDAYS(A1,B1)/5to get the number of 5-day work weeks. - Press Enter. For example, from Monday to Friday (5 days) gives 1 week. From Monday to the next Monday (6 weekdays) gives 1.2 weeks.
- To exclude holidays, add a range of holiday dates as a third argument:
=NETWORKDAYS(A1,B1, $F$2:$F$10)where F2:F10 contains holiday dates. - Note: This counts the start and end days. If you want to exclude the start day, subtract 1 from the result.
Method 7: Dates in Different Rows (Drag Down)
- If your dates are in columns (e.g., A2:A10 for start, B2:B10 for end), enter the formula in C2:
=(B2-A2)/7. - Click the fill handle (the small square at the bottom-right of the cell) and drag it down to fill the formula for all rows.
- Excel automatically adjusts the cell references for each row. If you need absolute references (e.g., a fixed end date), use dollar signs like
=$B$1-A2.
Common Mistakes
- Dates entered as text: If you type dates like "2025-01-01" as text, Excel won't subtract them correctly. Enter dates using the DATE function (e.g.,
=DATE(2025,1,1)) or format cells as Date before typing. - Reversed dates: If the start date is after the end date, the result will be negative. Check your cell references.
- Dividing by 7 but forgetting parentheses: In Excel,
=B1-A1/7divides A1 by 7 first, then subtracts from B1 – a completely different result. Always use parentheses:=(B1-A1)/7. - Using ROUND incorrectly:
=ROUND((B1-A1)/7)without the second argument (num_digits) defaults to 0, but it's safer to include the comma and 0 explicitly. - Formatting the result as a date: If the result cell is formatted as Date, you'll see a weird serial number. Set the cell format to Number or General.
Tips
- Use DATEDIF for precise whole weeks: While
=INT((B1-A1)/7)works, DATEDIF is more explicit and less prone to floating-point errors. - For ISO weeks (Monday-based), use
=INT((B1-A1)/7)– it's already Monday-based because Excel's date serial numbers are day-based. - If you need the week number of a date (e.g., week 12 of the year), use
=WEEKNUM(A1)– but that's a different calculation. - To calculate weeks between today and a date, use
=INT((TODAY()-A1)/7)– this updates daily. - For a dynamic end date that is always today, replace B1 with TODAY().
- If you want to exclude weekends entirely (not just count weekdays), use
=NETWORKDAYS(A1,B1)but note that this counts days, not full weeks – dividing by 5 gives business weeks.
Troubleshooting
If the formula returns #VALUE! – Check that both cells contain actual dates, not text. Use the ISDATE function (in newer Excel) or try formatting the cells as Date. If the cells contain text like "Jan 1, 2025", Excel might still parse it, but if it's a string like "2025-01-01", it may fail. Use DATEVALUE to convert text to a date: =DATEVALUE("2025-01-01").
If the result is a negative number – Swap the cell references, or use the ABS function: =ABS((B1-A1)/7) to get the absolute value.
If the result is a decimal like 3.428571 and you want 3.43 – Format the cell to show fewer decimal places, or use ROUND to round the value.
If DATEDIF returns #NUM! – This happens when the start date is after the end date. Reverse the arguments. Also, DATEDIF requires the start date to be the first argument.
If NETWORKDAYS returns a value that seems too high – Remember it includes both the start and end dates. For example, Monday to Friday is 5 days, not 4. If you want the number of weekdays in between, subtract 1: =NETWORKDAYS(A1,B1)-1.
If the formula works but the result shows as a date (like 01/01/1900) – This is a formatting issue. Right-click the cell, choose Format Cells, and select Number or General.
Frequently Asked Questions
How do I calculate the number of full weeks between two dates?
Use =INT((B1-A1)/7) to get the number of complete 7-day periods. For example, 20 days gives 2 full weeks (since 20/7 = 2.857, INT truncates to 2).
Can I calculate weeks between dates in different sheets?
Yes, reference the sheet name in the formula: =(Sheet2!B1-Sheet1!A1)/7. Make sure the sheet name is in single quotes if it contains spaces (e.g., ='My Sheet'!A1).
How do I calculate weeks between two dates excluding weekends?
Use =NETWORKDAYS(A1,B1)/5 to get the number of 5-day work weeks. This excludes Saturdays and Sundays. To also exclude holidays, add a range of holiday dates as a third argument.
What if my dates include times (e.g., 2025-01-01 14:30)?
Excel stores times as fractional days. The formula =(B1-A1)/7 will include the time difference. If you want to ignore times, use =INT(B1)-INT(A1) first to get whole days, then divide by 7.
Is there a way to calculate weeks between dates in Google Sheets?
Yes, the same formulas work. Google Sheets also has a DATEDIF function, but it may behave slightly differently for some units. The basic =(B1-A1)/7 works identically.
How do I calculate the number of weeks from a date to today?
Use =INT((TODAY()-A1)/7) where A1 is the past date. This updates automatically each day. If the date is in the future, use =INT((A1-TODAY())/7).