Finding preceding dates

egrigson
egrigson ✭✭
edited 12/09/19 in Formulas and Functions

I've created a productivity dashboard for myself and need to find a formula that returns the previous months so I can reference them in a COUNTIFS statement. I have a formula which works fine BUT it doesn't cope when the date crosses a year boundary, ie if the month is September (month 8) my formula will get August's stats using MONTH(TODAY())-1, which returns 7 (as I want). In January however the same formula returns 0, which is January (month 1) minus 1. How can I get this to return 12 for December? 

Thinking about it this will also apply to the year part of the date, so I need a way to create a formula which takes the current month (say Jan 2019) and returns the previous month, including the relevant year (so December 2018).

Thanks.

Tags:

Comments

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!