View the index value

Hi,
I can’t find a solution to this problem…
I have a set of users who are associated with a value A through a special field in the Users table.
I should sort all the users based on this value and have the index of the user logged in at that time displayed in a textbox.
Can anyone help me with this?
Thanks