=ROWS($B$1:XLOOKUP(P18,B:B,B:B))
This returns the row number where column B matches the amount in P18.
P18=194.42
In column B:
Row#4 = 194.42
Row#7 = 194.42
Since 2 rows in column B are 194.42 this is returning the earliest row #4 when I need it to return the last row #7.
use xlookup search_mode
-1 is to search from the last entry to the first
XLOOKUP(P18,B:B,B:B,,,-1)