DEV Community

Andrews
Andrews

Posted on • Originally published at geekexcel.com on

Formula to Count Number of Weekends/Weekdays/Specific Day of Week!!

Excel Formula to Count the Number of Weekends/ Weekdays/Specific Day of Week Between Two Dates:

This page will show the details on the Formula to Count the number of Weekends/Weekdays/Specific Day of Week Between Two Dates in Excel Office 365. Get an official version of MS Excel from the following link: https://www.microsoft.com/en-in/microsoft-365/excel

Formula Syntax:

  • Here we will explain three types of formulas.

Count the Number of Weekends:

  • First, we will see the formula for counting the number of weekends between two dates.

=IF($C$3>=$C$2,INT((WEEKDAY($C$2-1)-$C$2+$C$3)/7)+INT((WEEKDAY($C$2-6)$C$3-1)/7)+INT((WEEKDAY($C$3-6)-$C$3+$C$2)/7))

Example 1:

  • Let’s consider the below table to count the number of weekends between the two dates.
  • First, you need to enter the inputs of the Start Date and End date.
  • Then, you need to apply the given formula in the selected formula bar.
  • After entering the formula, you can get the result in the selected cell as shown below.

OutputCount the Number of All Weekdays:

  • The below formula is used for Counting the Number of All Weekdays Between two dates.

=IF($C$3>=$C$2,INT($C$3-$C$2)+1-(INT((WEEKDAY($C$2-1)-$C$2+$C$3)/7)+INT((WEEKDAY($C$2-7)-$C$2+$C$3)/7)),INT($C$2-$C$3)+1-(INT((WEEKDAY($C$3-1)-$C$3+$C$2)/7)+INT((WEEKDAY($C$3-7)-$C$3+$C$2)/7)))

Example 2:

  • In the below screenshot, you can know the steps for counting the number of all weekdays using the formula.
  • You need to enter the inputs of Start Date and End Date.
  • After that, enter the given formula in the selected area.
  • Finally, it will display the results in the selected cell.

Result

Formulas to count the Number of Specific Weekday Between Two Dates:

  • To find the number of specific weekdays between two dates, use the below formula.

=ABS(INT(WEEKDAY($C$2-5)-$C$2+$C$3)/7))

Example 3:

  • Let’s consider the below screenshot to count the number of specific weekdays between two dates.
  • You need to enter the input dates as shown in the image.
  • After that, enter the given formula in the selected field.
  • Finally, you will get the results as shown below.

Output

Explanations for Syntax:

  • IF – The ExcelIF function is used to returns one value for a TRUE result, and another one value for a FALSE result.
  • *INT * -The main purpose of INT Function is to round a given integer number down to the nearest integer.
  • *WEEKDAY * – It will return a number ranging from 1 to 7 which represents a day of the week for a given date. Read more on WEEKDAY Function.
  • ABS – This function will return the absolute value of a number. For more details on ABS Function.

Verdict:

From this article, you can get the clarification on the formulas for counting the number of weekdays/weekends/specific days of a week between two date-times in the Excel Office 365. If you have any suggestions, drop it in the below comment section. Thank you so much for Visiting Our Site!! Continue learning on Geek Excel!!

Top comments (0)