Month before last month?

Options

I use this for the previous month, what would I use for the month before last month?

AND(IFERROR(MONTH(@cell), 0) = MONTH(DATE(YEAR(TODAY()), MONTH(TODAY()), 1) - 1), IFERROR(YEAR(@cell), 0) = YEAR(DATE(YEAR(TODAY()), MONTH(TODAY()), 1) - 1)))


Thank you.

Answers

  • Mark Cronk
    Mark Cronk ✭✭✭✭✭✭
    Options

    Hi @Mike Miles ,

    =IFERROR(IF(MONTH(@cell)= 1, 11, IF(MONTH(@cell)=2,12, MONTH(@cell)-2)),"")

    You'll need to doentify the range for @cell to work.

    Help?

    Mark


    I'm grateful for your "Vote Up" or "Insightful". Thank you for contributing to the Community.

  • Mike Mills
    Mike Mills ✭✭✭
    Options

    Thanks. I'm actually using SUMIFS to pull data from another sheet that has data by location and date. (multiple years). Here is the formula I'm using for the previous month, which works but I can't figure out how to pull data for the month before last.

    =SUMIFS({Data}, {Data Location}, Item@row, {Data Date}, AND(IFERROR(MONTH(@cell), 0) = MONTH(DATE(YEAR(TODAY()), MONTH(TODAY()), 1) - 1), IFERROR(YEAR(@cell), 0) = YEAR(DATE(YEAR(TODAY()), MONTH(TODAY()), 1) - 1)))

    Thanks

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!