# checkbox formula for last 30 days

✭✭✭✭✭✭

Hi,

I have a date column which lists down all the dates in the year and a checkbox formula. In the checkbox column, I would like to insert a formula that would perform the following function for me:

If the date in the date column (row@cell) is in the last 30 days then checkbox.

Tags:

• ✭✭✭✭✭✭

@95766 Try something like this:

=IF(AND([Date Column]@row >= TODAY(), [Date Column]@row <= TODAY(30)), 1)

• ✭✭✭✭✭✭

Try something along the lines of...

=IF(AND([Date Column]@row >= TODAY(-30), [Date Column]@row <= TODAY()), 1)

This is assuming there will be dates that are also in the future.

If ALL dates are in the past and you want to just grab the past 30 days, you could remove the AND and the second argument.

=IF([Date Column]@row >= TODAY(-30), 1)

• ✭✭✭✭✭✭

@Paul Newcome That worked like a charm. Thank you as always!

• ✭✭✭✭✭✭

Happy to help. 👍️

• ✭✭✭

I need the opposite.... Check the box IF the date is WITHIN the next 30 days. I can't seem to reverse engineer the formula.

• ✭✭✭✭✭✭

@95766 Try something like this:

=IF(AND([Date Column]@row >= TODAY(), [Date Column]@row <= TODAY(30)), 1)

• ✭✭✭

@Paul Newcome Thank you!!!!!

• ✭✭✭✭✭✭

Happy to help. 👍️

• Looking for some additional help @Paul Newcome

I'm trying this formula, and it works to check the box if the date is in 2024, but if the date is older year, it doesn't check the box.

For example, the date 1/5/24, works and checks the box. 1/5/23, does not work, the box is not checked.

The formula I'm using: =IF([Volunteer Service Agreement (per term)]@row >= TODAY(-365), 1)

• ✭✭✭✭✭✭

@allisonwat That's how the formula is supposed to work. It will check the box for any date that is within the past 356 days. If you wanted a formula that will check the box for dates that are more than 365 days in the past, you will need to reverse your argument.

>=

changes to

<=

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!