Forum Discussion

Excelsius's avatar
Excelsius
Copper Contributor
Apr 11, 2023

Mark the fifth same Value red

Hello all,

I need your help, please.

In a column, if a value occurs 5 times, I want to mark the last value in red. There should be no criterion. All values that occur more than 5 times, the last one should be marked red.

  • Patrick2788's avatar
    Patrick2788
    Silver Contributor

    Excelsius 

    Presuming the values are in A2:A31, for example:

     

    Conditional formatting formula:

    =LET(counter,COUNTIF($A$2:$A2,$A2),total,COUNTIF($A$2:$A$31,$A2),AND(counter>=5,counter=total))

Resources