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
 10.7K Get Help
 63 Global Discussions
 69 Industry Talk
 385 Announcements
 3.5K Ideas & Feature Requests
 55 Brandfolder
 125 Just for fun
 50 Community Job Board
 464 Show & Tell
 40 Member Spotlight
 44 Power Your Process
 28 Sponsor X
 234 Events
 7.3K Forum Archives
Check out the Formula Handbook template!