@Glenn Kennedy much appreciated brother, it worked perfectly if Column "A" contained a number.

how about if column "A" contained text letters instead of numbers? can the formula be edited to give a similar result?
i.e. column "A" contained the location name and on "E1" I will right the desired location, the "G" column should also do the same work accordingly.

can that be possible, please?

appreciated your usual support on this matter.

I have attached again the workbook with the new references

unique values formula if match criteria.xlsx