How to Display an Index Page Range with a Hyphen in Word
Question details
The user wants to format index entries to show a continuous page range with a hyphen (e.g., 1-4) instead of listing individual page numbers.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Creating or updating a document index where a single topic spans across multiple consecutive pages.
- Observed behavior
- Word lists index entries as separate pages (e.g., 1, 2, 3, 4) rather than displaying a consolidated page range.
Ensure that you have hidden formatting symbols enabled (Ctrl+Shift+8) so you can view and edit the hidden XE (Index Entry) field codes in your document.
Use Bookmarks and the XE Field Range Switch
By creating a bookmark for the text spanning multiple pages and using the '\r' switch in your index entry, Word will group the pages into a hyphenated range.
Instead of marking individual words on each page, you can mark the entire section with a bookmark and tell the index to reference that bookmark's start and end points using the \r switch.
Select the text that spans the multiple pages you want to index. Go to the Insert tab, click on Bookmark, type a descriptive name without spaces (e.g., 'IndexTopic1'), and click Add.
Place your cursor immediately after the bookmarked text. Press Ctrl+F9 to insert empty field code braces { }. Inside the braces, type the XE field code referencing your bookmark: XE "Your Entry Text" \r "IndexTopic1".
Scroll down to your generated Index. Right-click anywhere inside the index and select Update Field. The index will now display the entry with a hyphenated page range.

Create Professional Indexes Easily with WPS Office
WPS Writer offers a highly intuitive interface for document formatting, including advanced indexing and bookmarking. Follow these steps to easily set up page ranges in your index using WPS Office.
- 1. Select text and add a bookmark: Open your document in WPS Writer. Highlight the continuous text spanning multiple pages, navigate to the Insert tab, click Bookmark, assign a name, and click Add.
- 2. Mark the index entry: Go to the References tab and click Mark Entry. In the dialog box, under 'Options', select 'Page range' and choose the bookmark you just created from the drop-down menu.
- 3. Generate or update the index: Click Mark to insert the hidden field. Finally, navigate to your index page, right-click the existing index, and choose Update Field to see the hyphenated page numbers.

Frequently Asked Questions
Why does my index show page 1, 2, 3 instead of 1-3?
This happens when the index entry is marked separately on each page or the default 'Current page' Mark Entry behavior is used. To group them into a continuous range, you must apply a bookmark to the entire range and use the '\r' switch in the XE field.
How do I make XE field codes visible in my document?
XE fields are formatted as hidden text by default. You can toggle the visibility of field codes and hidden text by clicking the Show/Hide ¶ button on the Home tab or by pressing the Ctrl+Shift+8 keyboard shortcut.
Can I manually type a hyphenated page range directly in the index?
While you can manually edit the generated index text to include a hyphen, any manual changes will be permanently lost the next time you update or refresh the index. It is highly recommended to use bookmarks and the XE field range switch for dynamic, error-free updates.




