To count the days in a month, you can use the DAY Function and the EOMONTH Function.
The DAY function returns the day of the date, e.g., "Jan 18, 2016" returns 18, the day in January.
The EOMONTH Function returns the last day of the month that is the indicated number of months before or after the start date.
Please use the following formula to calculate the days in the month of the date.
=DAY(EOMONTH(A2,0))
Where A2 is the cell with the date.
Example: To calculate the days in the month of the date November 1, 2015 in Cell A3
– EOMONTH(A3,0) returns the last day in November, which is November 30, 2015.
– DAY(EOMONTH(A3,0)) returns the day of date November 30, 2015, which is 30.
Please check how to calculate days in a year for the days in a year.