Go Back

How to Get Days in a Month using EOMONTH and DAY functions

We can use the EOMONTH and DAY functions to get the number of days in the month when we already have a single date. The steps below will walk through the process.

Figure 1: Result of using the DAY and EOMONTH functions

General Formula

=DAY(EOMONTH(date,0))

Formula

=DAY(EOMONTH(B5,0))

Setting up the Data

  • We will set up data by inputting our Dates in Column B
  • Our result, which is the Number of days in a month will be returned in Column C

Figure 2: Setting up the Data

Calculate the number of days using EOMONTH and DAY

  • We will click on Cell C5
  • We will insert the formula below into the cell
    =DAY(EOMONTH(B5,0))
  • We will press the enter key

Figure 3: How to get the days of the month

  • We will click on Cell C5 again
  • We will double click on the fill handle tool which is the small plus sign you see at the bottom right of Cell C5. Select and drag down to copy the formula to other cells.

Figure 4: Result of using the DAY and EOMONTH functions

Explanation

=DAY(EOMONTH(B4,0))

Our DAY function is always equal to the number of days in the month. The EOMONTH function checks the date in Cell B4 and returns the date corresponding to the last day of the month we specified. Next, the DAY function works on the data derived by the EOMONTH and return with the total number of days for that month.

Instant Connection to an Expert through our Excelchat Service

Most of the time, the problem you will need to solve will be more complex than a simple application of a formula or function. If you want to save hours of research and frustration, try our live Excelchat service! Our Excel Experts are available 24/7 to answer any Excel question you may have. We guarantee a connection within 30 seconds and a customized solution within 20 minutes.

Did this post not answer your question? Get a solution from connecting with the expert.

Another blog reader asked this question today on Excelchat:
Here are some problems that our users have asked and received explanations on

how can i built in all the days of a month in a month using a dynamic calendar
Solved by K. H. in 23 mins
I need to have all the days in the month change over automatically for a particular month when i enter in the first day of the month
Solved by B. J. in 13 mins
how do I calculate the number of business days in a month?
Solved by O. B. in 12 mins

Leave a Comment

avatar