COUNTIFS failing to accurately count
I'm trying to show how many projects are requested in the next 30 days by department:
I’ve gone through the videos and I believe I have set up my formulas correctly; however, the counts are incorrect.
I'm using the formula =COUNTIFS({Department}, Department@row, {Due date}, <=TODAY(+30))
It's probably something minor that I've overlooked but I cannot seem to get this formula correct. Please help.
Thank you,
Laura
Best Answer
-
Hi @Laura2022
Instead of changing the formula to only = TODAY(), Paul was meaning to add in an additional criteria so you have a range of dates to look through.
Ex:
=COUNTIFS({Department}, Department@row, {Due date}, <=TODAY(+30), {Due date}, >=TODAY())
This will look for any dates that are less than or equal to 30 days from now, but only if they are also greater than or equal to Today.
I also notice that your Department is a multi-select column. In this instance you'll want to use the HAS Function when you're looking for your Department, to see if the cell has this value along with other selections.
Try:
=COUNTIFS({Department}, HAS(@cell, Department@row), {Due date}, <=TODAY(+30), {Due date}, >=TODAY())
Cheers,
Genevieve
Join us at Smartsheet ENGAGE 2024 🎉
October 8 - 10, Seattle, WA | Register now
Answers
-
Are you able to provide a screenshot of the source data? I do see that you are looking for anything that is less than or equal to TODAY(30). This means a date from 12 years ago will also be counted because it is less than the date that is 30 days from today.
Try adding in another range criteria set where the range is the same date range and the criteria is greater than or equal to TODAY().
Come see me in Seattle at ENGAGE 2024! I will be at the 10xViz partner booth throughout as well as the "Lets Talk About Community" Meet & Eat table on Tuesday from 11:45am - 12:45pm!
-
Thank you for your quick response. Here's a screenshot of my source datasheet:
I tried using greater than or equal to TODAY() but the Requested column numbers are still off; if I set it to equal to TODAY(), I get a zero.
-
Hi @Laura2022
Instead of changing the formula to only = TODAY(), Paul was meaning to add in an additional criteria so you have a range of dates to look through.
Ex:
=COUNTIFS({Department}, Department@row, {Due date}, <=TODAY(+30), {Due date}, >=TODAY())
This will look for any dates that are less than or equal to 30 days from now, but only if they are also greater than or equal to Today.
I also notice that your Department is a multi-select column. In this instance you'll want to use the HAS Function when you're looking for your Department, to see if the cell has this value along with other selections.
Try:
=COUNTIFS({Department}, HAS(@cell, Department@row), {Due date}, <=TODAY(+30), {Due date}, >=TODAY())
Cheers,
Genevieve
Join us at Smartsheet ENGAGE 2024 🎉
October 8 - 10, Seattle, WA | Register now -
Thank you both. I was able to successfully recalculate the data and it's reflecting what it should!
-
Wonderful! I'm glad we could help 🙂
Join us at Smartsheet ENGAGE 2024 🎉
October 8 - 10, Seattle, WA | Register now
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63K Get Help
- 379 Global Discussions
- 212 Industry Talk
- 442 Announcements
- 4.6K Ideas & Feature Requests
- 140 Brandfolder
- 129 Just for fun
- 130 Community Job Board
- 449 Show & Tell
- 30 Member Spotlight
- 1 SmartStories
- 304 Events
- 34 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!