DAYSINMONTH in Zoho Sheet: month length and leap-year examples

Date and Time Beginner to Intermediate Zoho Sheet

Count the calendar days in any month with DAYSINMONTH, including leap-year February, and use the result in billing formulas.

Verification status: Official documentation referenced; example outcomes independently reasoned or arithmetically checked where stated. Not executed in Zoho Sheet. How formula examples are checked

Zoho Sheet DAYSINMONTH: find out how many days are in a month

Quick answer: =DAYSINMONTH(B2) returns the number of calendar days in the month containing the date in B2. For a date in February 2024, the expected result is 29 because 2024 is a leap year; for February 2025, it is 28. The function is designed for reporting, calendar checks, monthly proration and month-end workflows where a hard-coded 30- or 31-day month would be wrong.

DAYSINMONTH gives month length, not the number of days remaining, the number of workdays, or the day of the month. Compare DAY(date) (returns a day-of-month number) with DAYSINMONTH(date) (returns 28, 29, 30 or 31). Mixing the two is a common formula mistake.

Exact documented syntax

=DAYSINMONTH(date)
Argument Required? Meaning Recommended input
date Yes A date in the month whose length you need. A reference such as B7 containing a genuine date value.

Zoho’s DAYSINMONTH help article lists one argument and uses =DAY(EOMONTH(...;0)) as an alternative. This is important for portability: the dedicated Zoho function avoids an extra nested expression, but an EOMONTH-based calculation is familiar in Excel.

A leap year is usually divisible by 4, except a century year is a leap year only if divisible by 400. Thus 2000 is leap and 1900 is not. This is a Gregorian calendar property, not evidence that every historical date serial works in every spreadsheet application. The worked examples below use modern valid dates.

Create the sample worksheet

Import the accompanying calendar-boundaries-practice.csv into a sheet named CalendarChecks and convert date strings in columns B:D to true dates. For this page, the relevant columns are B = Report date, E = Monthly fee, and F = Days used. The other columns support companion WEEKS tutorials. Avoid assuming that a CSV’s 2024-02-29 string was automatically recognized as a date; inspect the imported cell format.

Row ID B: Report date E: Monthly fee F: Days used
2 W01 2021-01-01 290 12
3 W02 2020-12-31 310 8
4 W03 2026-10-11 280 4
5 W04 2024-12-30 290 10
6 W05 2026-01-04 310 2
7 W06 2024-02-29 290 1
8 W07 2025-02-28 280 20
9 W08 2026-12-31 310 31

Step-by-step: determine the month length

  1. In H1, enter Days in month.
  2. In H2 enter =DAYSINMONTH(B2) and format H2 as a whole Number, not a Date.
  3. Fill H2 down through H9. Check against the following independently computed predictions:
Row Month Formula pattern Expected number of days
2 January 2021 =DAYSINMONTH(B2) 31
3 December 2020 =DAYSINMONTH(B3) 31
4 October 2026 =DAYSINMONTH(B4) 31
5 December 2024 =DAYSINMONTH(B5) 31
6 January 2026 =DAYSINMONTH(B6) 31
7 February 2024 =DAYSINMONTH(B7) 29
8 February 2025 =DAYSINMONTH(B8) 28
9 December 2026 =DAYSINMONTH(B9) 31
  1. To test a 30-day month not present in the CSV, place an actual April 15, 2026 date in another cell or construct it without ambiguous text: =DAYSINMONTH(DATE(2026;4;15)) should produce 30 according to independent Gregorian calendar arithmetic.
  2. Compare your native outputs before relying on the examples operationally; no Zoho workbook was executed in this research pass.

Why February differs: The formula uses the year from the input date as well as the month. A hard-coded list saying February always has 28 days fails in leap years. The leap-day row demonstrates the function’s most valuable edge case.

Advanced application 1: calculate a month-end flag

Suppose reporting entries are stored in B2:B9 and a final review is required only if an entry is on the last day of its month. Combine DAY and DAYSINMONTH:

=IF(DAY(B7)=DAYSINMONTH(B7);"Month end";"Earlier in month")

For B7 = February 29, 2024, the independent result is Month end. For B4 = October 11, 2026, it is Earlier in month. Because DAY returns the day number and DAYSINMONTH returns the month’s maximum day number, equality identifies the final calendar day. This is useful for cutoff checks and monthly close dashboards, but it does not determine a business-day cutoff or bank holiday rules.

You can also construct the last-day date rather than a flag:

=DATE(YEAR(B7);MONTH(B7);DAYSINMONTH(B7))

Independent result: February 29, 2024 (display depends on date formatting). This formula deliberately uses a date constructor with an explicit year, month and day rather than an ambiguous typed string. Zoho also documents the shorter equivalent concept =EOMONTH(B7;0); equivalence for an unusual malformed date must be tested in the actual application.

Advanced application 2: prorate a fixed monthly fee

If the monthly fee is in E and the number of billable calendar days in F, an illustrative calendar-day proration is:

=ROUND(E7/DAYSINMONTH(B7)*F7;2)

For B7 = February 29, 2024, E7 = 290 and F7 = 1, independently calculate 290 ÷ 29 × 1 = 10.00. For B8 = February 28, 2025, E8 = 280 and F8 = 20, the independent result is 280 ÷ 28 × 20 = 200.00. These are arithmetic scenarios—not accounting policy recommendations. Contracts may prorate using working days, 30/360, fixed billing periods, inclusive start/end rules, or taxes instead.

To avoid negative or impossible billed days, set a validation requirement such as 0 <= F7 <= DAYSINMONTH(B7). A record with 31 billed days in February should be reviewed instead of automatically paid. When any cell contains an error or a blank, add business-specific guards rather than quietly calculating a zero charge.

Errors, edge cases and troubleshooting

  • 28, 29, 30 or 31: A normal Gregorian month is exactly one of those lengths; the year matters only for February. Do not assume arbitrary strings containing 2024-02 are valid date values.
  • #VALUE!: Zoho’s generic function help lists invalid argument types. Check that B7 contains a genuine date and not text copied from an export. The exact behavior for malformed text is untested here.
  • #NAME!: Check spelling DAYSINMONTH, parentheses, and formula separator. Do not substitute DAY, which is another function.
  • #REF!: A referenced date cell may have been deleted or moved.
  • Formatting confusion: A return value of 29 shown as an unexpected date can be fixed by displaying the result as Number; the function returns a count.
  • Dynamic example: Zoho’s reference prints a result next to DAYSINMONTH(TODAY()). That outcome depends on the day when TODAY is evaluated; a static help-page screenshot is not a prediction about the user’s current month.
  • Financial schedules: Calendar days are not the same as workdays. Use the separately documented NETWORKDAYS function if weekends and holidays matter, after verification of those rules.
  • Timezone/version uncertainty: The official web article does not specify a minimum first-supported version or guarantee the same parsing in every offline/desktop/mobile client.

Excel and Google Sheets alternatives

Microsoft Excel documents EOMONTH, which returns the date at the end of the month. Combining it with DAY yields the number of days: =DAY(EOMONTH(B7,0)) in a typical English Excel formula. The Zoho reference uses semicolons, e.g. =DAY(EOMONTH(B7;0)). There is no basis in these references to claim that Excel supports a dedicated DAYSINMONTH function under that name; use the documented alternative when migrating. The same EOMONTH-and-DAY technique can be researched for Google Sheets, but no Google Sheets formula was executed or used as evidence about Zoho behavior here.

Zoho’s desktop beta announcement refers broadly to 400+ supported built-in functions. It does not establish native DAYSINMONTH parity across platform, account, or old release. Do not invent a minimum release or attribute the date-count test to a native client.

Official reference and verification

Verification status: Official documentation checked; example outcomes were independently reasoned or arithmetically checked where applicable. Not executed in Zoho Sheet.

  • No genuine Zoho Sheet screenshots are included; this guide does not use mock application images.