# DAY formula generator

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

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

DAY returns the day of the month from a date, as a number from 1 to 31.

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

## Tested DAY examples

### Calculate the days remaining in the month

`=EOMONTH(A2,0)-A2`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/days-remaining-in-the-month)

### Get the number of days in a month

`=DAY(EOMONTH(A2,0))`

Excel. Result on the sample sheet: 6 rows (B2:B7). [See it and try it](https://spreadsheetpractice.com/formulas/days-in-a-month)

### Calculate pacing to a monthly goal

`=(C2/B2)/(DAY($G$1)/DAY(EOMONTH($G$1,0)))`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/pacing-to-a-monthly-goal)

### Prorate a monthly amount by days

`=C2*(EOMONTH(B2,0)-B2+1)/DAY(EOMONTH(B2,0))`

Excel. Result on the sample sheet: 5 rows (D2:D6). [See it and try it](https://spreadsheetpractice.com/formulas/prorate-a-monthly-amount-by-days)

### Convert a date to text

`=TEXT(A2,"yyyy-mm-dd")`

Excel. Result on the sample sheet: 5 rows (B2:B6). [See it and try it](https://spreadsheetpractice.com/formulas/convert-a-date-to-text)

## Questions

### What does the DAY formula generator do?

You describe the task in plain English, and it writes the formula, using DAY 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 DAY do?

DAY returns the day of the month from a date, as a number from 1 to 31.

### Can I learn to write DAY 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 DAY 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.
