Calculating past date from a January Birthday

I thought I had this all figured out a while back, until diving back in now I notice that a handful of my dates are not working correctly. I figured out it is all of the rows where the person has a birthday in the first couple weeks of January.

I want to take the birthday and create a date range that a survey can be completed (Birth date +/- 30 days). My formula is

=IF(OR([Current Visit]@row = "3 to 5 Year", [Current Visit]@row = "6 to 10 Year", [Current Visit]@row = "11 to 17 Year", [Current Visit]@row = "1 Year", [Current Visit]@row = "2 Year"), IFERROR(DATE(YEAR(DOB@row) + [Year End Age]@row, MONTH(DOB@row) - 1, DAY(DOB@row)), DATE(YEAR(DOB@row), MONTH(DOB@row), 1)), , ""))

If anyone might know where I could fix the formula, that would be very helpful! Thank you in advance.

Tags:

Best Answer

  • Paul Newcome
    Paul Newcome ✭✭✭✭✭✭
    Answer ✓

    One month before would be:

    =IFERROR(DATE(YEAR(End@row), MONTH(End@row) - 2, DAY(End@row)), DATE(YEAR(End@row) - 1, MONTH(End@row) + 10, DAY(End@row)))

    One month after would be:

    =IFERROR(DATE(YEAR(TODAY()) + IF(TODAY() > IFERROR(DATE(YEAR(TODAY()), MONTH(DOB@row) + 1, DAY(DOB@row)), DATE(YEAR(TODAY()) + 1, 1, DAY(DOB@row))), 1, 0), MONTH(DOB@row) + 1, DAY(DOB@row)), DATE(YEAR(TODAY()) + IF(TODAY() > IFERROR(DATE(YEAR(TODAY()), MONTH(DOB@row) + 1, DAY(DOB@row)), DATE(YEAR(TODAY()) + 1, 1, DAY(DOB@row))), 2, 1), 1, DAY(DOB@row)))

Answers

Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!