I'd like to return the number of days in a month in column B, based on the date in column A. The problem is, column A does not have a specific date (01/01/2017, etc.), but only has the month listed (JAN, FEB, MAR...) so the functions that I've seen to do this so far won't work.

mollyj:column A . . . only has the month listed

So what are you expecting for February? "28 most of the time, but occasionally 29?" "¯\_(ツ)_/¯?"

A bit long, but try this in column B

~~=DAY(EOMONTH(DATEVALUE(MONTH(DATEVALUE(A1&" 1"))&"/1/2017"),0))~~

~~Will only be valid for year 2017~~Updated formula:

=DAY(EOMONTH(DATEVALUE(MONTH(DATEVALUE(A1&" 1"))&"/1/"&YEAR(TODAY())),0))

Should work for all years.

MIKE

message edited by mmcconaghy

Here is an even shorter formula: =DAY(EOMONTH(DATEVALUE(A1&" 1"),0))

MIKE

message edited by mmcconaghy

Ask Your Question

Weekly Poll