Days in Month: Google Sheets Formula

Danielle Jul 09, 2026

Ever found yourself needing to calculate the number of days in a month in Google Sheets? You're not alone. This essential task is a common requirement in various fields, from finance to project management. Let's delve into how to achieve this efficiently and effectively.

Google Sheets Calendar Templates | Firstprintable
Google Sheets Calendar Templates | Firstprintable

Google Sheets offers a simple and intuitive way to calculate the number of days in a month, even accounting for leap years. By using a combination of built-in functions and simple formulas, you can automate this task and save time.

Google Sheets Weekly & Monthly Schedule Templates
Google Sheets Weekly & Monthly Schedule Templates

Understanding the DAY() Function

The DAY() function in Google Sheets is your key to calculating the number of days in a month. It returns the day of the month for a given date. Let's explore its syntax and usage.

Free Google Sheets Weekly Schedule Template & Calendars
Free Google Sheets Weekly Schedule Template & Calendars

Syntax: DAY(date)

Basic Usage

One-Page Monthly Planner, 12 Months Yearly Overview Spreadsheet for Google Sheets & Excel Template, Excel Annual Calendar Template
One-Page Monthly Planner, 12 Months Yearly Overview Spreadsheet for Google Sheets & Excel Template, Excel Annual Calendar Template

To find the number of days in a specific month, you can use the DAY() function with a date in that month. For instance, DAY("2022-12-01") will return 1, indicating December 1, 2022, is the first day of the month.

However, to find the total number of days in a month, you need to consider the last day of the month. DAY("2022-12-31") will return 31, indicating December 2022 has 31 days.

Calculating Days in a Month

Google Sheets Weekly & Monthly Schedule Templates
Google Sheets Weekly & Monthly Schedule Templates

To find the total number of days in a month, you can subtract the day of the first day of the month from the day of the last day. For example, DAY("2022-12-31") - DAY("2022-12-01") + 1 will give you the total number of days in December 2022.

However, this method doesn't account for leap years. In a leap year, February has 29 days instead of the usual 28. To account for this, you can use the EOMONTH() function, which returns the date of the last day of the specified month.

Accounting for Leap Years

Monthly Habit Tracker Spreadsheet | Boost Your Productivity Today!
Monthly Habit Tracker Spreadsheet | Boost Your Productivity Today!

Leap years occur every four years, with an extra day (February 29) added to the calendar. To ensure your calculations are accurate, you need to account for these leap years.

Google Sheets' DAY() function automatically adjusts for leap years. For instance, DAY("2020-02-29") will return 29, indicating February 2020 had 29 days due to it being a leap year.

Free Google Docs Calendar Templates
Free Google Docs Calendar Templates
Professional Monthly Calendar
Professional Monthly Calendar
Monthly Content Calendar Free Google Sheets & Excel Template
Monthly Content Calendar Free Google Sheets & Excel Template
Google Sheet Daily Planning Templates: Unlock Productivity
Google Sheet Daily Planning Templates: Unlock Productivity
How to Create a Calendar in Google Sheets From Scratch - Make Tech Easier
How to Create a Calendar in Google Sheets From Scratch - Make Tech Easier
8 Free Google Sheets & PDF Budget Templates | Cute Personal Finance & Monthly Money Planners
8 Free Google Sheets & PDF Budget Templates | Cute Personal Finance & Monthly Money Planners
Free Google Sheets Planner Template to Organize Your Life
Free Google Sheets Planner Template to Organize Your Life
Google Sheets Weekly & Monthly Schedule Templates
Google Sheets Weekly & Monthly Schedule Templates
Organize Your Month: Free Google Sheets Planner Template, Monthly Budget
Organize Your Month: Free Google Sheets Planner Template, Monthly Budget
Monthly Budget Planner Google Sheets Template
Monthly Budget Planner Google Sheets Template
Google Sheets Weekly & Monthly Schedule Templates
Google Sheets Weekly & Monthly Schedule Templates
a spreadsheet showing the task tracker for each task, including tasks and numbers
a spreadsheet showing the task tracker for each task, including tasks and numbers
Aesthetic Monthly Habit Tracker and Time Slot Organizer for Google Sheets
Aesthetic Monthly Habit Tracker and Time Slot Organizer for Google Sheets
Google Sheets Editable Monthly Calendar Spreadsheet
Google Sheets Editable Monthly Calendar Spreadsheet
Master Your Month: Free Monthly Spreadsheet Template
Master Your Month: Free Monthly Spreadsheet Template
Create a Google Sheets Second Brain
Create a Google Sheets Second Brain
2025, 2026 & Beyond Habit Tracker in Google Sheets (Free Template)
2025, 2026 & Beyond Habit Tracker in Google Sheets (Free Template)
Optimize Your Schedule with Google Sheets Calendar & Recipe Templates
Optimize Your Schedule with Google Sheets Calendar & Recipe Templates
Habit Tracker Spreadsheet – Build Better Habits with Google Sheets & Excel
Habit Tracker Spreadsheet – Build Better Habits with Google Sheets & Excel

Using EOMONTH() for Leap Years

The EOMONTH() function returns the date of the last day of the specified month. When used with a date in a leap year, it will return the date of the last day of the following month, accounting for the extra day in February.

For example, EOMONTH("2020-02-29", 0) will return "2020-02-29", indicating February 2020 had 29 days due to it being a leap year.

Calculating Days in a Month with EOMONTH()

To find the total number of days in a month, you can subtract the day of the first day of the month from the day of the last day, using EOMONTH() to get the last day of the month. For example, DAY(EOMONTH("2022-12-01", 0)) - DAY("2022-12-01") + 1 will give you the total number of days in December 2022, accounting for leap years.

Mastering these functions and techniques will enable you to calculate the number of days in a month in Google Sheets with ease. Whether you're planning a project, managing a budget, or tracking a deadline, accurate day counting is crucial. So, the next time you need to find out how many days are in a month, you'll know exactly how to do it.