logo
search
Formatting Issues

How to Display an Index Page Range with a Hyphen in Word

WPS Content ManagerWPS Content Manager Sep 27, 2026 869 views

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.

How to Display an Index Page Range with a Hyphen in Word
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.
Before you start

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.

Solution 1Recommended

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.

1
Bookmark the continuous text

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.

2
Insert the XE field code

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".

3
Update the document index

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.

Use Bookmarks and the XE Field Range Switch
Index Updated Successfully: The hyphenated page range will automatically adjust if you add or remove text within the bookmarked area later.
Professional Word Processing

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. 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. 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. 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.
Free and lightweight word processorFully compatible with Microsoft Word document formats (.docx)Intuitive interface for managing bookmarks and indexesSeamlessly supports advanced field codes like XE for complex formatting
microsoft office alternative - wps office

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.