Forum Discussion

Kaloyan Stoyanov's avatar
Kaloyan Stoyanov
Copper Contributor
Mar 14, 2018

Formula to count cell with conditional formatting

Hi,

 

I have a data table that's mainly with dates. The B column - "Deadline", is with referential dates, and in subsequent columns are the dates to each individual. I'm using conditional formatting to highlight individual entries that are past the deadline:

=AND(ISNUMBER(C2),C2>$B2)

 

I need some sort of a total row to count the highlighted entries as per column and row.

 

Some posts online suggested a macro, but I could find only one that displays a pop-up box with the result once ran - I need something that behaves like a proper formula.

 

I tried doing it with COUNTIFS, applying the same condition as on the formatting, but I can't get it to work.

I used the below code (Alexander Phillips is an example column with individual data):

=COUNTIFS([Alexander Phillips],ISNUMBER([Alexander Phillips]),[Alexander Phillips],[Deadline]<[Alexander Phillips])

I get 0 as a result. I tried with COUNTIF and the condition is grouped with AND, the result is the same.

 

Also, I don't know how to lock the column in a data table formula so it wouldn't change when I drag it - similar to $ for a normal data range.

 

Can you help?

 

Thanks

  • Hi Kaloyan,

     

    I'd suggest

    =SUMPRODUCT( ISNUMBER([Alexander Phillips])*([Alexander Phillips]>Table1[[Deadline]:[Deadline]]))

    With COUNTIFS every second parameter shall be criteria only, without repeating the range

     

    Please see attached

  • Hi Kaloyan,

     

    I'd suggest

    =SUMPRODUCT( ISNUMBER([Alexander Phillips])*([Alexander Phillips]>Table1[[Deadline]:[Deadline]]))

    With COUNTIFS every second parameter shall be criteria only, without repeating the range

     

    Please see attached

Resources