# COUNTIFS function with multiple criteria/specific date range

✭✭✭✭✭

Hello!

I've been having trouble getting this formula correct. Here are the details.

I want to count the number of "Agree Strongly" and "Agree Somewhat" in the Survey Results column when the date is the current month in the date column.

=COUNTIFS({Survey Results Range 1}, OR(@cell = "Agree Strongly", @cell = "Agree Somewhat", {Date Range 2}, IFERROR(MONTH(@cell), 0) = MONTH(TODAY()), {Date Range 2}, YEAR(@cell) = 2021))

Thank you!!

Tags:

• ✭✭✭✭✭✭

Just the smallest of tweaks is needed to make it work- the OR statement wasn't closed.

=COUNTIFS({Survey Results Range 1}, OR(@cell = "Agree Strongly", @cell = "Agree Somewhat"), {Date Range 2}, IFERROR(MONTH(@cell), 0) = MONTH(TODAY()), {Date Range 2}, YEAR(@cell) = 2021)

If this is all of the Agree Statements you have, CONTAINS is an alternative you could use in place of the entire OR statement: {Survey Results Range 1}, CONTAINS("Agree", @cell)

cheers

Kelly

• ✭✭✭✭✭

Thank you very much Kelly! At first it was still now working, but I figured out it was because my Date column that I was pulling off of contained a "LEFT" formula to bring in just the date from on an Auto-number/System column that was bringing in the created date plus the time. Can you not pull in info with a formula based on another cell with a formula in it?

Good news is, once I remove that LEFT formula and with your help above, I got it to work! I can change our form to have the user put in the date instead of using the Auto-Number/System column.

Thanks again!

• ✭✭✭✭✭

Actually, it looks like you can pull the formula off of the Auto-Number/System column that has both the date and time without having to use the LEFT formula to get a column with just the date. I should've tried that first!

Thank you again! Have a great week!

## Help Article Resources

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!