Getting the Days per Month/Year with DROPLEVEL() and EXPAND()
By combining DROPLEVEL(EXPAND()), you can easily get the days in a month
By using
DROPLEVEL(EXPAND(1,“Day”),”Day”)
you get the days in a month. This holds true even for leap years and other irregularities.
Similarly, by using
DROPLEVEL(EXPAND(1,“Day”),“Month”)
you get the number of days in each quarter.
Finally, by using
DROPLEVEL(EXPAND(1,”Day”),”Quarter”)
You can get the number of days in each year.