I have a range of IP address and I want to color highlight the duplicates but only where the C class is duplicate.

108.162.199.172
108.162.199.89
109.68.38.20
109.69.80.242
109.69.80.245

The 'C class' is actually the third octect. For example, in 108.162.199.172, C class is : 199. In 109.68.38.20, C class is 38 and so on.

I have used the duplicate conditional formatting to find the exact duplicates but don't know how to do find the C class duplication.

Can anybody help me please?

Thanks