Inverted form index, how do you making a alphabetical index in a book where the last name comes first

how do you make a inverted form index? I’m trying to make a alphabetical index in a book of peoples names where the last name comes first. How do you do this?

Could you clarify?

Lastname1, Firstname1
Lastname2, Firstname2

Lastname2, Firstname2
Lastname1, Firstname1

Firstname1 Lastname1
Firstname2 Lastname2

Firstname2 Lastname2
Firstname1 Lastname1

like John Smith, in the index it would read Smith, John

How did you enter the index entries? For best diagnostic, attach a 1-page example file.

Usually for that, index “key” are not inherited from text but manually encoded. In other words, you select “John Smith”, insert an Index Entry and you type “Smith, John” in the dialog which pops up.

PS: Since your post contains no technical data, don’t provide additional details in a comment but edit your post (click on or + below it then on the “pencil” icon to enter edit mode) to mention OS name, LO version (exact 4 numbers at least) and save format. Attach the sample file to the post.