How to Control Record Sequencing in Microsoft Word Mail Merge Using NEXT and NEXTIF Fields

In standard Microsoft Word mail merges—such as form letters or single-recipient invoices—Word automatically advances to the next record in your data source only when it completes an entire page or document section. When generating multi-record documents such as mailing labels, name badges, product price tags, or multi-item inventory directories, relying on default page-break advancement causes Word to repeat the first data record across all cells of a single sheet. To instruct Word precisely when to fetch subsequent data records or conditionally skip specific entries, you must implement the NEXT and NEXTIF field codes.

How the NEXT Field Code Operates

The NEXT field code instructs the Word merge engine to immediately advance the pointer in the connected data source (such as an Excel spreadsheet, CSV file, or Access table) to the subsequent row without generating a page break. When subsequent MERGEFIELD placeholders appear further down the page or in adjacent table cells, they read data from this newly advanced record.

The syntax for the basic field is straightforward:

{ NEXT }

When placed at the beginning of a label block or repeated table row, { NEXT } shifts the data buffer forward. This enables printing 10, 20, or 30 distinct records on a single printed page.

Inserting the NEXT Field in Repeating Layouts

When creating multi-record layouts manually (or when customising label templates), each repeated block—except the very first block on the page—must begin with a NEXT field.

Structuring a Multi-Record Table or Label Sheet

  1. In your Word document, create your layout using a table (for example, a 2-column by 4-row grid for badges).
  2. In the first cell (Row 1, Column 1), insert your desired merge fields normally:
    «First_Name» «Last_Name»
    «Company»
    «Email»
    Do not place a NEXT field in this first cell; the merge engine automatically points to Record 1 at the start of the job.
  3. In the second cell (Row 1, Column 2), place your cursor at the very top.
  4. Press Ctrl + F9 (or Command + F9 on macOS) to insert raw field brackets { }.
  5. Inside the brackets, type NEXT so it reads:
    { NEXT }«First_Name» «Last_Name»
    «Company»
    «Email»
  6. Copy this entire cell structure into all remaining cells on the page (Row 2, Row 3, etc.).
  7. When Word processes the merge, Cell 1 displays Record 1; Cell 2 executes NEXT and displays Record 2; Cell 3 executes NEXT and displays Record 3; and so on.

When Word reaches the end of the page, the native document pagination automatically advances to the next record for Cell 1 on Page 2, maintaining continuous sequencing without skipped rows.

Conditional Record Advancement Using NEXTIF

While the standard NEXT field advances unconditionally, the NEXTIF field evaluates an expression before advancing the data pointer. If the logical test evaluates to true, Word increments to the next data record; if the test evaluates to false, Word remains on the current record or skips evaluation depending on layout context.

The syntax for NEXTIF requires an expression, a comparison operator, and a comparison value:

{ NEXTIF Expression1 Operator Expression2 }

Supported Comparison Operators

Operator Function Example Field Construction
= Equal to { NEXTIF «Status» = "Active" }
<> Not equal to { NEXTIF «AccountType» <> "Pending" }
> Greater than { NEXTIF «Balance» > 0 }
>= Greater than or equal to { NEXTIF «Score» >= 75 }
< Less than { NEXTIF «Age» < 18 }
<= Less than or equal to { NEXTIF «Units» <= 10 }

For example, if you want to skip inactive accounts in a continuous list layout, you can evaluate the status column before fetching the record fields:

{ NEXTIF «Status» = "Active" }«Customer_Name» - Account: «Account_ID»

Toggling Field Codes and Previewing Merges

When working with complex merge fields in Word, you frequently need to switch between the underlying code structure and the rendered values:

  • Toggle Field Codes: Press Alt + F9 (or Option + F9 on macOS) to toggle all fields in the document between their code brackets { NEXT } and their hidden execution state.
  • Toggle Single Field: Select an individual field and press Shift + F9.
  • Update Fields: Select all text (Ctrl + A) and press F9 to re-evaluate formulas and links.
  • Preview Results: On the Mailings tab, click Preview Results to inspect the merged output with live database rows.

Troubleshooting Common NEXT Field Errors

If your merged documents produce skipped records or duplicated names, verify the following configuration points:

  • Skipping Every Other Record: If Record 1, Record 3, and Record 5 appear while even records disappear, you have likely inserted a { NEXT } field into a standard single-page letter template where Word’s automatic section break already advances records. Remove manual { NEXT } fields from single-record-per-page layouts.
  • Leading Cell Positioning: In label merges, ensure the very first label in the top-left corner does not contain a { NEXT } field. If it does, your merge will permanently skip the first record of your dataset.
  • Nested Quotes: When using string values in NEXTIF expressions that contain spaces, enclose the comparison text in standard straight quotes (e.g., "United Kingdom").

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.