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.



  • DKazatsky2
    DKazatsky2 ✭✭✭✭✭

    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,


  • 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

Want to practice working with formulas directly in Smartsheet?

Check out the Formula Handbook template!