# WEEKDAY formula generator

> Describe what you need and get a WEEKDAY formula for Excel and Google Sheets, run on real data before you copy it. Plus 8 tested WEEKDAY examples.

Source: https://spreadsheetpractice.com/tools/formula-generator/weekday · Updated October 29, 2026 · Formulas and results on this page were run by the Spreadsheet Practice formula engine on November 20, 2026

WEEKDAY returns the day of the week for a date as a number.

Describe the task at [WEEKDAY formula generator](https://spreadsheetpractice.com/tools/formula-generator/weekday) and get a WEEKDAY formula for Excel and Google Sheets, tested on real data.

## Tested WEEKDAY examples

### Get the Monday of the week from a date

`=A2-WEEKDAY(A2,3)`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/monday-of-the-week)

### Calculate the week ending date

`=A2+7-WEEKDAY(A2)`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/week-ending-date)

### Get the start and end dates of last week

`=A2-WEEKDAY(A2,3)-7`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/start-and-end-dates-of-last-week)

### Count dates that fall on a weekend

`=SUMPRODUCT(--(WEEKDAY(B2:B11,2)>5))`

Excel. Result on the sample sheet: 4. [See it and try it](https://spreadsheetpractice.com/formulas/count-weekend-dates)

### Count dates by week

`=COUNTIFS($B$2:$B$13,">="&E2,$B$2:$B$13,"<"&E2+7)`

Excel. Result on the sample sheet: 4 rows (F2:F5). [See it and try it](https://spreadsheetpractice.com/formulas/count-dates-by-week)

### Sum by week

`=SUMIFS($C$2:$C$11,$A$2:$A$11,">="&E2,$A$2:$A$11,"<"&E2+7)`

Excel. Result on the sample sheet: 3 rows (F2:F4). [See it and try it](https://spreadsheetpractice.com/formulas/sum-by-week)

### Look up a rate based on the day of the week

`=INDEX($F$2:$F$8,WEEKDAY(A2,2))`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/rate-by-day-of-week)

### Sum by day of the week

`=SUMPRODUCT((TEXT($A$2:$A$13,"ddd")=D2)*$B$2:$B$13)`

Excel. Result on the sample sheet: 7 rows (E2:E8). [See it and try it](https://spreadsheetpractice.com/formulas/sum-by-day-of-the-week)

## Questions

### What does the WEEKDAY formula generator do?

You describe the task in plain English, and it writes the formula, using WEEKDAY where that's the right tool, for your table or a sample one. The formula is run in our engine in Excel and Google Sheets mode before you see it, so you get its result, not just a guess.

### What does WEEKDAY do?

WEEKDAY returns the day of the week for a date as a number.

### Can I learn to write WEEKDAY formulas myself?

Yes. Each example below opens a page where you try the formula in a live grid and it's checked as you go, and the WEEKDAY function page has a practice exercise.

---

Spreadsheet Practice (https://spreadsheetpractice.com) teaches spreadsheet formulas by practice: every exercise is graded in a live grid and re-checked on changed data.
