# I am trying to count the dates that occurred within the past 10 days

Options
✭✭

I am struggling in counting the dates (under a date column) that occured within the past ten days. It is coming out as unparseable. I used the formula below:

=countif ([date]:[date], <=(TODAY()-7)

I would appreciate the help.

• ✭✭✭✭✭✭
Options

I can see a couple of problems:

1. The function should be capitalized. This will cause the UNPARSEABLE error.

=COUNTIF(date:date, <=(TODAY() - 7))

2. Once this works, it will count where the date in the date column is before or on the date 7 days before today. That is not dates that occurred within the past 10 days.

The formula below will give you dates on or after the date 9 days ago. Note - Any future dates will also be included so you might need to add a second criteria (using COUNTIFS) if there is a possibility of your column including dates in the future

=COUNTIF(date:date, >=(TODAY() - 9))

• ✭✭✭✭
Options

Hi @GeeAre - To count the dates that occurred within the past 10 days I would recommend to use the following formula:

=COUNTIFS(Date:Date, <TODAY(), Date:Date, >=TODAY(-10))

OR you can also use the following format:

=COUNTIFS(Date:Date, AND(@cell < TODAY(), @cell >= TODAY(-10)))

Cheers!

• ✭✭
Options

The second formula worked, thank you! Can you tell me why you added @cell?

• ✭✭✭✭✭✭
Options

The @cell argument enables you to efficiently perform the two calculations at the same time.

It is basically saying that you want to count if the date in the cell is less than today and also the date in the cell is after or on the date 10 days before today.

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!