Hello!
I know about the MATCH function, so this is not a problem which can be solved by this or other similar formulas (as far as I know).

I've got a formula which returns a value (the formula I used for returning a value is XLOOKUP). If there were to be a single instance of this value, then its row number could easily be found, but there are multiple instances of this value.

Adjacent to these values, there is a code, and these codes are different. This way I can differentiate the values. When I use XLOOKUP, the lookup value is the code, and the return array is the value's column. What is being returned is the value, but when I use MATCH, it returns the row of the first instance of the value, not the row where XLOOKUP got the value from.

English is not my main language and I hope I was coherent enough in order for you to understand my problem.
Thank you.