Search code examples
excelexcel-formulaexcel-tables

Show Duplicates except the first value, when using Excel Tables


I want to check for duplicate values in Veh Trx ID column, and give a TRUE if it repeats (except for the first value), and if they are all unique values then display FALSE. I have already managed to do it when using traditional Excel formula in Col A: =COUNTIF($H$3:$H3,H3)>1.

The problem arises because I have to now use table headers, so I changed my formula in Col A to: COUNTIF(Ops_Table[@[Veh Trx ID]:[Veh Trx ID]]: Ops_Table[[Veh Trx ID]:[Veh Trx ID]],Ops_Table[[Veh Trx ID]:[Veh Trx ID]])>1

It does indicate the duplicate Veh Trx ID with value of TRUE, but I wanted the first duplicate to still say FALSE, and the following duplicates to remain TRUE. Please help.

Thanks in advance.


Solution

  • Use OFFSET:

    =COUNTIF(OFFSET(Ops_Table[[#Headers],[Veh Trx ID]],0,0,ROW($ZZ1)+1),[@[Veh Trx ID]])>1
    

    enter image description here