How to Create a Word Index by Surname and Given Name
Question details
The user needs to create a document index where names are alphabetized and listed by surname first, followed by the given name, even when the names are written in standard given-name order in the document text.
- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Creating a professional document index formatted alphabetically by last name for authors, characters, or subjects.
- Observed behavior
- By default, generating an index directly from selected text lists names exactly as they appear in the document, requiring manual configuration of the index entry fields to achieve the desired formatting.
Ensure that hidden formatting marks are visible in your document, as this will allow you to see, edit, and troubleshoot the hidden index entry (XE) fields effectively.
Use the Mark Index Entry Dialog Box
This is the standard and most straightforward method to assign a surname as the main entry and the given name as an indented subentry or standard comma-separated entry.
By splitting the name into a Main Entry and a Subentry, Word will automatically nest the given name under the surname in your final generated index. Alternatively, you can place the entire reversed name in the Main Entry box if you prefer no nesting.
Highlight the complete name (e.g., 'Jane Smith') as it appears in your document text.
Navigate to the References tab on the ribbon and click on 'Mark Entry' in the Index group.
The selected name will appear in the 'Main entry' box. Cut the given name ('Jane') from this box, paste it into the 'Subentry' box, and leave only the surname ('Smith') in the Main entry field.
Click the 'Mark' button to tag this specific instance, or click 'Mark All' to automatically tag all occurrences of this exact name throughout the document.

Insert and Edit XE Fields Manually
Use this method if you prefer using keyboard shortcuts or need to quickly copy and paste index fields directly within the text.
Easily Create Professional Indexes in WPS Writer
WPS Writer offers a comprehensive set of reference tools, allowing you to create, format, and update document indexes with ease. The Mark Entry feature and XE field handling work identically to Microsoft Word, ensuring a smooth and familiar formatting experience.
- 1. Open your document in WPS Writer: Launch WPS Office and open the document where you need to compile an index.
- 2. Access the References tab: Navigate to the 'References' tab on the top ribbon and locate the 'Mark Entry' button.
- 3. Configure the Index Entry: Input the surname in the 'Main entry' field and the given name in the 'Subentry' field (or format as 'Surname, Given Name' in the Main entry entirely), then click 'Mark'.
- 4. Insert the final Index: Place your cursor at the end of your document, click 'Insert Index' under the References tab, choose your preferred style, and click OK.

Frequently Asked Questions
How do I update the index after adding new surname entries?
Right-click anywhere inside the existing index block and select 'Update Field', or simply click on the index and press the F9 key on your keyboard. This will refresh the index to include any newly marked XE entries in the document.
Why can't I see the XE tags in my document after marking an entry?
XE (Index Entry) tags are formatted as hidden text by design so they don't print or disrupt your reading layout. To view them, go to the Home tab and click the Show/Hide ¶ button, or press the shortcut Ctrl+Shift+8.
How do I fix a misspelled index entry I already marked?
Turn on the Show/Hide ¶ feature to reveal your hidden XE fields in the document body. Locate the specific `{ XE "..." }` code containing the error, click inside the quotation marks, manually retype or fix the spelling, and then update your index by pressing F9.




