Can COUNTIFS or COUNTIF count the number of rows based on the comparison between two date columns?
I simply just want to know the number of rows where the SD is greater than TD. The formula is actually what I got from Smartsheet's AI assistant. I think it makes sense and there is no error message, but it does not return with the correct value. So, I wonder if anyone has a solution to this?
Both SD and TD columns are set as date, HD is text/number.
Answers
-
Hi @Xiaopeng,
I'm not sure you can get a count by comparing the columns in that manner - someone else can weigh in if that's not the case.
One way to accomplish this would be to create a helper column that counts each row individually and then sum that column in your "HD" column.
The helper column formula would look like this: =COUNTIF(SD@row, > TD@row)
The formula in HD would look like this: =SUM([Count (helper)]:[Count (helper)])
Hope this helps,
Dave
-
Thanks @DKazatsky2. Yes, a helper column may help as a workaround.
Above question is a simplified case so everyone can understand. I still wonder if there is a way to run argument based on comparison of two columns in COUNTIF or COUNTIFS.
Help Article Resources
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.8K Get Help
- 437 Global Discussions
- 138 Industry Talk
- 470 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 65 Community Job Board
- 486 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives
Check out the Formula Handbook template!