By using both the Day function and the EOMONTH function, we can find the number of days in a given month e.g. to find how many days are in the month of Oct.
How the formula works
The formula used above is:
=DAY(EOMONTH(A4,0)) where the DAY function is used to find days in a month, a number from 1 to 31 and the EOMONTH function is used to return a date corresponding to the last day of the month.