Q:

How conditionally to colour a cell based on the most bottom repeated value?

I have an Excel file that contains information like:
Invoice#,   Company Name, Amount
Invoice001, Company 001,  100.00
Invoice002, Company 002,  120.00
Invoice003, Company 003,  130.00
Invoice004, Company 001,  140.00
Invoice005, Company 158,  160.00
Invoice006, Company 003,   45.00

I want the cell background colour for the most recent repeated company invoice number (ie the highest numbered - but they are ordered in my spreadsheet top to bottom) to have a green background.
In my example, the cells with the background green colour would be the cell with the company name for Invoice004 (not Invoice001 even though it is the same customer but it isn't the most recent invoice), Invoice002, Invoice006 (not Invoice003 - same reason as Invoice004) and Invoice005.
Ideally I just want to do this with a formula in the cell to change the background colour.

A:

=OR(COUNTIF(B$2:B$10,B2)=1,COUNTIF(B3:B$10,B2)=0)

to be applied as a conditional formatting formula starting from A2 with B$10 adjusted as necessary.
On reflection, the first COUNTIF isn't necessary: just that there are no more recent invoices for the same customer, assuming that the invoices are in chronological order:-
=COUNTIF(B3:B$10,B2)=0

