Suppose you are in a situation where you have to calculate weeks from some given date range. And you need to calculate cost estimation by using those weeks, for instance. So how will you calculate those weeks? Well, you can calculate those using your calculator, or you can do it in Excel in a faster way. Guess what our topic is today? That’s right! This is how you can calculate the number of weeks between two dates in Excel.
Let’s assume we have a dataset, namely the Everest Base Camp Expedition timeline. You can use any dataset suitable for you.
We have used the Microsoft Office 365 version; you may use any other version according to your convenience.
1. Using INT Function
Firstly, you can calculate the number of weeks between two given dates by doing a simple mathematical calculation. We will subtract two given dates and then divide them by 7 to get the number of weeks. To get an integer value, we will use the INT function.
📌 Steps:
- Select cell D5 and apply the following formula given below.
=INT((C5-B5)/7)
Here, cells C5 and B5 represent the Ending Date and Starting Date respectively. In this formula, the mathematical subtraction returns the number of days first. Later, when the output is divided by 7, we get the number of weeks, but not in integers. That’s why we need to use the INT function to get the desired output.
- Then press ENTER.
- Drag the Fill Handle from cell D5 to D15.
- The final output will be given below.
2. Applying ROUNDDOWN Function
The ROUNDDOWN function returns the same output as found in the earlier method. Here, the output has been rounded down by using the ROUNDDOWN function.
📌 Steps:
- To begin, put the following formula in cell D5.
=ROUNDDOWN((C5-B5)/7,0)
- Then press ENTER.
- Drag the Fill Handle icon.
- As a result, your final output will be as follows.
Read More:Â Excel Formula to Count Days from Date
3. Utilizing the DATEDIF Function
In this method, we will learn how to calculate the number of weeks between two dates using the DATEDIF function. The method is not hard. All you need to know is how you use the DATEDIF function to do your task.
📌 Steps:
- Click on cell D5 and then type the following formula.
=ROUNDDOWN((DATEDIF(B5, C5, "d") / 7), 0)
- Press ENTER.
- Finally, drag the Fill Handle tool from cell D5 to D15 to get the rest of the value.
- The output will look like the one below.
4. Employing WEEKNUM Function
By using the WEEKNUM function, you can calculate the number of weeks between two given dates. But one thing you should keep in mind is that this function will provide you with the correct output if two dates (from which you want to find the number of weeks) are in the same year. Sounds Confusing? Not at all! You will understand the functionality if you look at the example that I have given below.
Suppose we have a data set that looks like this:
Now follow the steps that are given below.
📌 Steps:
- First, click on cell D5 and type the following formula.
=WEEKNUM(B5)-WEEKNUM(B5)
Basically, the WEEKNUM function returns the week number in a year from any specific date. For this reason, we have to use the function twice for each date.
- Press ENTER.
- Drag the Fill Handle tool as we have shown below.
- Thus, we get the values of the weeks as follows.
Calculating the Number of Weekdays Between Two Dates in Excel
Now, we can calculate our weekdays between given dates employing the DATEDIF function in our Excel sheet.
📌 Steps:
- Type the following formula in cell D5.
=(DATEDIF(B5, C5, "d"))
In this case, we used d in the 3rd argument as we want to find the number of days between two dates.
- Then press ENTER.
- Then drag the Fill Handle tool from cell D5 to D15 to get the other value.
- As a result, the output looks like this.
Read More: Excel Formula to Calculate Number of Days Between Today and Another Date
Calculating the Number of Months Between Two Dates in Excel
The Excel DATEDIF function also allows you to determine the number of months between two dates, like counting days.
📌 Steps:
- Type the following formula.
=(DATEDIF(B5, C5, "m"))
In this formula, m gives Excel the direction to count the month as we have previously learned for counting days.
- Then press ENTER.
- Drag the Fill Handle tool from cell D5 to D15 to get the other value.
- Finally, the output you get is as follows.
Read More: How to Count Months from Date to Today by Using Excel Formula
Calculating the Number of Years Between Two Dates in Excel
Similarly, you can also find the number of years between two dates utilizing the DATEDIF function in Excel.
📌 Steps:
- First, type the following formula for cell D5.
=(DATEDIF(B5, C5, "y"))
- Press ENTER.
- Next, drag the Fill Handle icon.
- In turn, the output you get is as follows.
Practice Section
Additionally, we have provided a practice section on the right side of each sheet so you can practice yourself. Please make sure to do it yourself.
Download Practice Workbook
You can download and practice the dataset that we have used to prepare this article.
Conclusion
We hope you have learned something new today through this tutorial. In fact, calculating the number of weeks between two dates is not hard at all, and we think all of us should learn this method to make our lives a little bit easier. Nevertheless, we will be at your disposal if you have any queries. Thank you.
Related Articles
- How to Calculate Expiration Date with Excel Formula
- How to Calculate Years from Today in Excel
- Calculate Years and Months Between Two Dates in Excel
- Calculate Number of Days between Two Dates with VBA in Excel
<< Go Back to Days Between Dates | Calculate Dates | Date-Time in Excel | Learn Excel
Get FREE Advanced Excel Exercises with Solutions!