COUNTIFS and Dates
Hi everyone -
I am working on a new process for one of my business units. They have multiple date fields within the sheet. I need to count the number of dates that are either today or in the past. If a date is entered in the future then they don't want to count it until the date is reach. For example:
Date 1 = 09/01/2021
Date 2 = 2/23/2022
Date 3 = 8/01/2022
In counting, I should only have a value of 2 until the other dates are reach but my formula is only returning a value of 1.
Here is my formula: =COUNTIFS([Date 1]@row, <=TODAY(), [Date 2]@row, <=TODAY(), [Date 3], <= TODAY())
Also, if the date field is blank, how do I not show a value of 0?
Hopefully that makes sense.
Best Answer
-
Thank you. That worked
Answers
-
You are asking COUNTIFS to evaluate if ALL the conditions you give are true, and if so, to return a value of true (aka "1".) It can't evaluate [Date 3] at all because you left off the @row after the column name. So instead of returning 0, it returned 1 since the the two criteria it could evaluate returned true. Split these apart into separate COUNTIF statements and add the results together:
=COUNTIF([Date 1]@row, <=TODAY()) + COUNTIF([Date 2]@row, <=TODAY()) + COUNTIF([Date 3]@row, <=TODAY())
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
-
Thank you. That worked
-
Glad it helped. If you could mark my answer as accepted I would appreciate it!
Regards,
Jeff Reisman
Link: Smartsheet Functions Help Pages Link: Smartsheet Formula Error Messages
If my answer helped solve your issue, please mark it as accepted so that other users can find it later. Thanks!
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 412 Global Discussions
- 220 Industry Talk
- 459 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 140 Just for fun
- 57 Community Job Board
- 461 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives