# Formula Stopped Working

Options

I've been using the below formula to calculate how many months have passed between dates (a single day in a month should have that month counted). It's been working perfectly for months, but recently I switched one of the columns from automatic population to manual (otherwise, no changes). It's now returning odd values, for example, my Date Opened and Date Closed both fell in March, and it returned a value of 3. Opened in March closed the previous January gives a value of 12, but closed in February gives 2 months. I have no idea what happened, and nothing I'm trying is fixing it. Any ideas?

=MONTH(([Date Closed]@row) - MONTH([Date Opened]@row) + ((YEAR([Date Closed]@row) - YEAR([Date Opened]@row)) * 12) + 1)

Tags:

• ✭✭✭✭✭✭
Options

It looks like I may have messed up the parenthesis this time. Ugh. Need... Coffee... Haha

=MONTH([Date Closed]@row) - MONTH([Date Opened]@row) + ((YEAR([Date Closed]@row) - YEAR([Date Opened]@row)) * 12) + 1

• ✭✭✭✭✭✭
Options

It looks like you may have some parenthesis tucked in that aren't needed. Lets try cleaning those up first to see if that helps...

=MONTH([Date Closed]@row) - MONTH([Date Opened]@row) + ((YEAR([Date Closed]@row) - YEAR([Date Opened]@row) * 12) + 1

• Options

Thanks Paul! I replaced the earlier formula and the result update from 3 to -22241. Screenshots, if those help - I have no idea what's gone wrong.

• ✭✭✭✭✭✭
Options

It looks like I may have messed up the parenthesis this time. Ugh. Need... Coffee... Haha

=MONTH([Date Closed]@row) - MONTH([Date Opened]@row) + ((YEAR([Date Closed]@row) - YEAR([Date Opened]@row)) * 12) + 1

• Options

Fixed, thank you so much!!

• ✭✭✭✭✭✭
Options

Happy to help. 👍️

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!