# Calculate Weeks Between Two Dates in Excel

- Written by Puneet

In Excel, you can use a formula to calculate the number of weeks between two dates. In this tutorial, we will learn to write this formula.

Here, in this example, we have two dates: the starting date is 01-Jan-2023, and the ending date is 04-Jul-2023.

## Formula to Get Weeks Between Two Dates in Excel

1. Enter TRUNC Function in a cell.
2. Minus the starting date from the ending date.
3. Divide it by 7 as there are 7 days in a week.
4. Close the function and hit enter to get the result.
``=TRUNC((B1-A1)/7)``

The moment you hit enter, it returns the count of complete weeks between the specified dates.

The way this formula works is simple: you subtract the starting date from the ending date to get the total number of days between the dates.

Then, divide that by 7 to get the number of weeks for those days. In the end, when you use the TRUNC function, it only returns the count of the complete weeks, ignoring the decimals.

But if you want to get the exact count of weeks, you can skip using the TRUNC function and use a simple formula like the following:

``=(B1-A1)/7``

And if you want to round an incomplete week as a complete week, you can use the ROUNDUP function.

In the ROUNDUP, you can use the same formula in the number argument and 0 in the num_digit.

``=ROUNDUP((B1-A1)/7,0)``