Excel: Count Day of Week in a Date Range
In this article
To count how many times a specific weekday (e.g., Monday) appears within a date range in Excel, use the SUMPRODUCT function with the WEEKDAY function: =SUMPRODUCT(--(WEEKDAY(range)=2)) for Monday, where range contains the start and end dates. This formula returns the total count of that weekday between the two dates, inclusive.
in start | Start Date | date | 2024-01-01 | 0 in end | End Date | date | 2024-12-31 | 0 in dow | Day of Week (1=Sun) | - | 2 | 1 out count | Count of Weekday | - | floor((end - start + 1 - dow + 7) / 7) | 0
Formula
The general formula to count a specific weekday between two dates is:
Count = FLOOR((End - Start + 1 - (WEEKDAY(Start) - TargetDay + 7) MOD 7) / 7)
Where:
- Start – the earlier date (as a serial number in Excel).
- End – the later date.
- TargetDay – the weekday number you want to count (1=Sunday, 2=Monday, ..., 7=Saturday).
- WEEKDAY(Start) – returns the weekday of the start date using the same numbering (1=Sunday).
The expression (WEEKDAY(Start) - TargetDay + 7) MOD 7 gives the number of days from the start date to the first occurrence of the target weekday. Subtracting that from the total days and dividing by 7 (then flooring) gives the number of full weeks, which equals the count of that weekday.
Worked Example
Using the calculator defaults: Start = 2024-01-01 (Monday), End = 2024-12-31 (Tuesday), TargetDay = 2 (Monday).
- Total days inclusive: 2024 is a leap year, so 366 days.
- WEEKDAY(2024-01-01) = 2 (Monday).
- Days to first Monday = (2 - 2 + 7) MOD 7 = 0.
- Count = FLOOR((366 - 0) / 7) = FLOOR(52.2857) = 52.
The calculator returns 52, which matches. There are 52 Mondays in 2024.
Why Use SUMPRODUCT Instead of COUNTIF?
COUNTIF cannot directly evaluate a condition based on the weekday of each cell. You could use an array formula with SUM and WEEKDAY, but that requires pressing Ctrl+Shift+Enter in older Excel versions. SUMPRODUCT handles arrays natively without special keystrokes, making it the most straightforward and robust approach.
For example, if your dates are in A2:A100, use:
=SUMPRODUCT(--(WEEKDAY(A2:A100)=2))
The double unary (--) converts TRUE/FALSE to 1/0 so SUMPRODUCT can sum them.
How to Count Weekdays Between Two Dates (Including/Excluding)
If you need to count all weekdays (Mon-Fri) between two dates, Excel has a built-in function: NETWORKDAYS(start, end). It excludes weekends (Sat/Sun) by default. To exclude holidays, add a third argument with a range of holiday dates.
For counting a single weekday, the SUMPRODUCT method is more flexible. You can also use SUMPRODUCT(--(WEEKDAY(range)=2)) to count Mondays, and change the number for other days.
Common Mistakes and How to Avoid Them
- Wrong weekday numbering: WEEKDAY defaults to 1=Sunday. If you think Monday is 1, your counts will be off. Use
WEEKDAY(date, 2)to make Monday=1, but then adjust the target number accordingly. - Off-by-one errors: The formula includes both start and end dates. If you need to exclude the start date, subtract 1 from the total days.
- Date stored as text: If your dates are text, WEEKDAY returns #VALUE!. Ensure cells are formatted as dates.
- Using COUNTIF with a condition: COUNTIF cannot evaluate WEEKDAY inside the criteria. Use SUMPRODUCT or an array formula.
Alternative Approaches
If you prefer a more visual method, you can use a helper column: add a column with =WEEKDAY(A2) and then use COUNTIF on that column. This is easier for beginners but adds a column to your sheet.
Another approach is using the SEQUENCE function (in Excel 365) to generate all dates and then filter by weekday. For example:
=SUM(--(WEEKDAY(SEQUENCE(end-start+1,,start))=2))
This creates an array of all dates and counts Mondays. It’s elegant but only works in dynamic array Excel versions.
Frequently Asked Questions
How do I count a specific weekday in a date range without a helper column?
Use =SUMPRODUCT(--(WEEKDAY(A2:A100)=2)) for Mondays. Replace the 2 with 1 for Sunday, 3 for Tuesday, etc. This works in all modern Excel versions.
Does the formula include both the start and end dates?
Yes, the formula counts the weekday in both the start and end dates if they fall on that weekday. For example, if your range is from Monday to Monday, it counts 2 Mondays.
What if my week starts on Monday?
Use =SUMPRODUCT(--(WEEKDAY(range,2)=1)) to count Mondays, because with type 2, Monday=1. Adjust the number accordingly for other days.
Can I count weekdays excluding holidays?
For counting all weekdays (Mon-Fri) excluding holidays, use NETWORKDAYS(start, end, holidays). For counting a single weekday excluding holidays, you would need a more complex array formula or a helper column with a holiday flag.
Why does my formula return 0?
Check that the range contains dates (not text) and that the weekday number matches your intended day. For example, if you use WEEKDAY(date) with no second argument, Sunday=1, so to count Sunday you need 1, not 7.
Is there a way to count weekdays in a date range using pivot tables?
Yes, you can add a calculated column with =WEEKDAY(date) and then use a pivot table to count rows by that column. This is useful for summarizing multiple weekdays at once.