Solved Excel formula to return number of days in a month?

September 26, 2017 at 16:47:40
Specs: Windows 7
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.

See More: Excel formula to return number of days in a month?

Reply ↓  Report •

#1
September 26, 2017 at 17:11:41
mollyj: column A . . . only has the month listed
So what are you expecting for February? "28 most of the time, but occasionally 29?" "¯\_(ツ)_/¯?"

How To Ask Questions The Smart Way


Reply ↓  Report •

#2
September 26, 2017 at 18:45:32
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

http://www.skeptic.com/

message edited by mmcconaghy


Reply ↓  Report •

#3
September 27, 2017 at 08:28:45
✔ Best Answer
Here is an even shorter formula:

=DAY(EOMONTH(DATEVALUE(A1&" 1"),0))

MIKE

http://www.skeptic.com/

message edited by mmcconaghy


Reply ↓  Report •
Related Solutions


Ask Question