+ Start a Discussion
David RightscorpDavid Rightscorp 

calculate amount of days in month

I need a formula that calculates how many days are in the current month.

I've been using this: DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1)
till now but it's starting to give me an error: #Error!

HELP!
Best Answer chosen by David Rightscorp
mjohnson-TICmjohnson-TIC
try
IF(MONTH(TODAY()) = 12, 31, DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1))

 

All Answers

mjohnson-TICmjohnson-TIC
try
IF(MONTH(TODAY()) = 12, 31, DAY(DATE(YEAR(TODAY()),MONTH(TODAY())+1,1)-1))

 
This was selected as the best answer
David RightscorpDavid Rightscorp
Wow LIFE SAVER!! Thanks mjohnson-TIC!! for the quickest reply!