Excel Number of Days in a Month

There are two ways to “excel number of days in a month”: the quick way you copy and the durable way you understand. This page gives you both. The exact Excel answer is above; below, we build the small mental model that makes the fix stick, so the next variation of the same problem solves itself.

Exact answer

In Excel: subtract the dates directly — =B2-A2 returns the number of days — and use =NETWORKDAYS(A2,B2) for working days (Mon–Fri, both dates inclusive); format the result as a Number, not a Date.

On this page7
▤Annotated stepsExcel
1

Put the start date in A2 and the end date in B2 (real dates, not text).

2

Days: =B2-A2. Working days: =NETWORKDAYS(A2,B2).

3

Holidays: list them in a range and use =NETWORKDAYS(A2,B2,holidays).

4

Format the result cells as Number — a date format would display the count as a date.

=B2-A2
Ctrl+CthenCtrl+Shift+V⌘+Cthen⌘+Ctrl+VPaste values · WindowsMac

What this does

Dates are serial numbers, so date arithmetic is plain subtraction: end minus start gives days. NETWORKDAYS counts only Monday–Friday and can exclude a holiday list as its third argument. For calendar-style answers ("3 years, 2 months, 12 days") DATEDIF decomposes the gap with its "y", "ym" and "md" units — it is documented by Microsoft but absent from the function list, so type it in full, and Microsoft advises against "md", which can return a negative number, a zero or a wrong result. Keep the inputs visible and clearly labelled and the whole thing stays auditable — anyone who opens the file later, including you, can see at a glance exactly what feeds the result and change one assumption without hunting through the formula. Treat “excel number of days in a month” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected cells shows up while it is still harmless. When a formula is involved, keep the inputs labelled beside it, reference cells instead of typing values, and apply number formatting only after the result checks out. That turns a calculation you can defend to a CFO or an auditor into a method you can reuse, explain, and defend when the workbook leaves your screen.

A worked example

A project starts 2026-01-01 (A2) and ends 2026-12-31 (B2). =B2-A2 returns 364 days. =NETWORKDAYS(A2,B2) returns 261 working days. =DATEDIF(A2,B2,"m") returns 11 full months. If the result shows as a strange date like 30.12.1900, the cell is formatted as Date — switch it to Number. Deadlines, ages, tenancy periods, SLA clocks — counting days (or working days) between two dates is one of the most common spreadsheet questions there is. Check the referenced cells, argument order and result type in your workbook. Start with the worked example before changing an input, then compare the changed result with the calculation you expected. An error value or a result of a different type is a reason to inspect the inputs and arguments.

In Google Sheets

Google Sheets support for this task has not been verified. Check the function, arguments and workflow in the target product before transferring the example. Matching formula notation does not establish identical behaviour. The aim was to get you unstuck fast and leave you a little more capable than a copy-paste would. The answer is at the top and the detail above shows why it holds — so the next time a colleague asks, you can answer without reaching for search. For “excel number of days in a month”, keep the input cells and the result visible while you check the formula in Excel. Follow the worked example and change one input at a time. The steps explain the workbook calculation; this page does not run a live calculator for that task.

Common mistakes

  • Result cell formatted as Date, showing 30.12.1900 instead of 364.
  • Text dates that look right but cannot be subtracted — DATEVALUE or re-entry fixes them.
  • Forgetting NETWORKDAYS counts BOTH endpoints: Monday to Friday of one week is 5, not 4.
  • Relying on DATEDIF's "md" unit near month ends — Microsoft documents it as unreliable.

Frequently asked questions

How do I count days between two dates in Excel?

Subtract them: =B2-A2, with the result cell formatted as Number.

How do I get working days only?

=NETWORKDAYS(start,end) for Mon–Fri, or =NETWORKDAYS.INTL for custom weekends; add a holiday range as the last argument.

Why isn't DATEDIF in Excel's function list?

It is a Lotus 1-2-3 compatibility function: absent from the wizard and from autocomplete, but documented by Microsoft and fully functional when typed — =DATEDIF(start,end,"y"). Microsoft does advise against the "md" unit.