# countif with date range

Options

Hi all. I am trying to count the number of line items in March 2022. This is my equation.

=COUNTIF([Planned Pull Date]:[Planned Pull Date], >=DATE(2022, 3, 1), <=DATE(2022, 3, 31))

It comes up is incorrect argument set. What am I doing wrong?

## Best Answers

• ✭✭✭✭✭✭
edited 02/23/22 Answer ✓
Options

You're close! You can use AND to consider two (or more) criteria for the same range.

=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(@cell >=DATE(2022, 3, 1), @cell <=DATE(2022, 3, 31)))

Alternatively, you can use YEAR and MONTH:

=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(YEAR(@cell) = 2022, MONTH(@cell) = 3))

AND Function | Smartsheet Learning Center

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

• Answer ✓
Options

You are a genius! Thank you so much @Jeff Reisman

## Answers

• ✭✭✭✭✭✭
edited 02/23/22 Answer ✓
Options

You're close! You can use AND to consider two (or more) criteria for the same range.

=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(@cell >=DATE(2022, 3, 1), @cell <=DATE(2022, 3, 31)))

Alternatively, you can use YEAR and MONTH:

=COUNTIF([Planned Pull Date]:[Planned Pull Date], AND(YEAR(@cell) = 2022, MONTH(@cell) = 3))

AND Function | Smartsheet Learning Center

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

• Answer ✓
Options

You are a genius! Thank you so much @Jeff Reisman

• ✭✭✭✭✭✭
Options

If only my teenage kids recognized that, LOL.

Happy I could help!

Regards,

Jeff Reisman

If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!