function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ 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!