FormulaCraft

How to count how many of a weekday are in a month in Excel and Google Sheets

Topic:COUNT & counting patterns
Excel & Google Sheets
=SUMPRODUCT((WEEKDAY(DATE(YEAR(A2),MONTH(A2),ROW(INDIRECT("1:"&DAY(EOMONTH(A2,0))))),2)=B2)*1)

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Put any date in the target month in column A (e.g., 2024-03-01).
  2. 2Put the weekday number to count in column B (1=Mon … 7=Sun using WEEKDAY mode 2).
  3. 3In C2 enter: =SUMPRODUCT((WEEKDAY(DATE(YEAR(A2),MONTH(A2),ROW(INDIRECT("1:"&DAY(EOMONTH(A2,0))))),2)=B2)*1)
  4. 4This builds a virtual array of every day in the month and counts how many match the target weekday.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

Can I count Sundays using this formula?

Yes — enter 7 in column B (WEEKDAY mode 2 maps Sunday to 7).

Does EOMONTH handle leap years?

Yes, EOMONTH automatically returns the correct last day, including February 29 in leap years.

More on COUNT & counting patterns

See all →

Formulas used

Related tasks

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: