Skip to main content

Kutools for Office — One Suite. Five Tools. Get More Done.

How to create increment number with or inside text in Excel?

Author Siluvia Last modified

In Excel, generating sequences of incrementing numbers is a fundamental task, especially for organizing data or creating unique identifiers. While the AutoFill Handle feature is an easy way to fill continuous standalone numbers, it doesn’t support combining incrementing numbers directly with text strings, such as generating "User001", "User002", and so on in a single step. This limitation can complicate tasks like creating custom usernames, email addresses, product codes, or invoice numbers that require both static text and a sequential numeric component. In this tutorial, we'll introduce several methods to create increment numbers integrated with or inside text strings in Excel, ranging from classic formulas to advanced automation with VBA and user-friendly specialized tools.

Common scenarios include: generating batches of uniquely labeled items, creating email lists with systematic naming, or producing serial numbers for product tracking. Each solution has its own advantages—whether it's ease of use, automation, flexibility in number placement, or suitability for large datasets.

create increment number with or inside text

Increment number with text by formula in Excel
Increment number with text with Kutools for Excel
VBA macro: create incrementing numbers within or inside text


Increment number with text by formula in Excel

Excel’s built-in formulas provide a straightforward method for combining text and incrementing numbers. This solution is particularly useful if your sequence is structured with fixed position numbers and text, and you need full transparency in how the identifier is composed.

1. Prepare your worksheet as illustrated below:

A. In cell A2, input the leading text string (for example, "User").
B. Column B should contain your incrementing numbers. Enter the first number (such as 1) in cell B2, and then drag down across the remaining cells to continue the sequential series. You can control the step interval here; for instance, fill B2 with1, B3 with 2, and so on, or use a series with a custom increment such as 2,4,6 (by entering your desired numbers and dragging the fill handle).
C. In cell C2, enter any additional text you’d like to append after the number (such as a domain "@localdomain.com" for generating emails). To prevent Excel from treating certain strings as formulas (e.g., email domains), format C2 and the corresponding cells as "Text" before entering data.

prepare the cell data

2. In cell D2, enter the following formula, then press Enter to apply:

=$A$2&TEXT(B2,"000")&$C$2

After the formula returns the result, drag the Fill Handle from D2 down to fill the rest of the cells in column D. Each cell will display the combined text and incremented number, such as “User001@localdomain.com”, “User002@localdomain.com”, etc., as shown below:

 Increment number with text by a formula

Notes and tips:

1. In the formula, “000” determines the minimum number of digits displayed (e.g., “001”, “002”). Adjust this pattern if you need a different digit width (e.g., “00” for two digits or “0000” for four digits).
2. Use absolute cell references ($A$2 and $C$2) to keep the text elements fixed when copying the formula down.
3. If you want numbers to appear inside the text (e.g., "User-001-list"), adjust the structure in the formula and place the number section within the text as needed.

This approach is highly transparent and ideal for well-structured data but often requires manual setup of helper columns for each component. Also, if your text and number placement varies from row to row, this approach may require extra modifications.


Increment number with text with Kutools for Excel

If you frequently need to generate incrementing text identifiers and prefer a graphical interface or want more dynamic options (such as flexible prefix, suffix, custom increments, or remembering your settings for repeated use), Kutools for Excel offers a specialized feature called Insert Sequence Number. With this tool, you can create complex numbering schemes in just a few clicks—no formula setup required.

Kutools for Excel offers over 300 advanced features to streamline complex tasks, boosting creativity and efficiency. Itegarate with AI capabilities, Kutools automates tasks with precision, making data management effortless. Detailed information of Kutools for Excel...         Free trial...

1. On the Excel ribbon, go to Kutools > Insert > Insert Sequence Number… as shown below:

click Insert Sequence Number feature of kutools

2. In the Insert Sequence Number dialog box, click New to expand additional setup options. Here’s how to configure:

A: In the Name field, enter a descriptive label for your sequence pattern. This helps if you want to reuse the same sequence in the future.
B: Specify the Start number (for example,1).
C: Set the Increment value to control the step increase (e.g., input 1 for 1,2,3…; input 5 for 1,6,11, etc.).
D: Define the No. of digits to determine leading zeros in your number (enter 3 for formatting as “001”, “002”…).
E: Fill in your preferred Prefix (text before the number) and Suffix (text after the number, such as an email domain).
F: Click Add to save this format as a template for future use.

set sequence rule in the dialog box

3. Select the range of cells where you want to insert the incrementing numbers with text, then click Fill Range. The customized numbers will instantly populate the selected area, yielding results like “User001@localdomain.com”, “User002@localdomain.com”…

click the Fill Range to fill the sequence list

Additional notes: Once you assemble and save a numbering template in Kutools, it can be quickly reused, even across multiple workbooks. If the last generated number was 30, the next time you use this sequence, the numbering will automatically resume from 31. This is especially helpful for avoiding duplicate numbers or tracking across large datasets.

This method is recommended for users who work with sequential data regularly and want both efficiency and flexibility in a point-and-click interface, plus template saving for recurring batch tasks. If you require advanced, position-based customization beyond prefix/suffix, automated scripting may be more suitable (see below).

  If you want to have a free trial (30-day) of this utility, please click to download it, and then go to apply the operation according above steps.

Increment number with text with Kutools for Excel

 

VBA macro: create incrementing numbers within or inside text

If you require maximum control—such as inserting an incrementing number into any part of a text string, generating complex identifiers on the fly, or applying this operation to multiple rows at once—a VBA macro provides automation and customization that formulas or add-ins can’t always match. VBA is ideal for bulk operations, customized patterns, or when needing to embed numbers anywhere (not just at the start or end) of the string.

Before you begin, always remember to save your workbook as a macro-enabled file (.xlsm) to prevent loss of your VBA code. Additionally, consider testing any macro on a copy of your data first to avoid unexpected changes.

How to use the macro:

1. Open your workbook, then on the Excel ribbon click Developer Tools > Visual Basic. (If the Developer tab is not visible, enable it via File > Options > Customize Ribbon.)

2. In the Microsoft Visual Basic for Applications editor window, click Insert > Module. Copy and paste the following code into the blank module:

Sub InsertIncrementNumberIntoText()
    Dim cell As Range
    Dim rng As Range
    Dim startNum As Long
    Dim increment As Long
    Dim pattern As String
    Dim position As Variant
    Dim currentNum As Long
    
    On Error Resume Next
    xTitleId = "KutoolsforExcel"
    
    Set rng = Application.Selection
    Set rng = Application.InputBox("Select the range to apply incremented text.", xTitleId, rng.Address, Type:=8)
    
    startNum = Application.InputBox("Enter the starting number:", xTitleId, 1, Type:=1)
    
    increment = Application.InputBox("Enter the increment between numbers:", xTitleId, 1, Type:=1)
    
    pattern = Application.InputBox("Enter the pattern (use {n} to mark the insertion point, e.g. 'User{n}@local.com'):", xTitleId, "User{n}@local.com", Type:=2)
    
    currentNum = startNum
    
    If rng Is Nothing Then Exit Sub
    
    For Each cell In rng
        cell.Value = Replace(pattern, "{n}", currentNum)
        currentNum = currentNum + increment
    Next
End Sub

3. To execute the macro, click the Run button button or press F5. A dialog will guide you to select the target range, set your starting number, choose the increment, and define your desired text pattern (for example, use ID-{n}-LIST to embed an incrementing number between custom text segments).

  • You can insert "{n}" anywhere in your pattern—before, after, or inside the text—to customize the placement of the incremented number.
  • After you confirm, each selected cell is filled with the appropriately incremented identifier based on your chosen pattern and interval.
  • To apply the macro to a new area, simply re-run it and specify new parameters as needed.
  • If you make a mistake, use the Undo feature (Ctrl+Z) or run the macro again.

Troubleshooting and tips:

• Always test on a data copy if possible—macros instantly overwrite original cell values.
• Ensure no cell in the selection is locked or protected, otherwise the macro will silently skip those cells.
• The macro supports any pattern containing {n}. Patterns without this token will be filled literally, so double-check your pattern before running.
• If you receive an error about macro security, set Excel to enable macros via File > Options > Trust Center > Trust Center Settings > Macro Settings.

This solution is especially useful for advanced scenarios such as embedding numbers within filenames, creating patterned IDs across multiple rows at once, and automating complex sequential naming schemes.


Best Office Productivity Tools

🤖 Kutools AI Aide: Revolutionize data analysis based on: Intelligent Execution   |  Generate Code  |  Create Custom Formulas  |  Analyze Data and Generate Charts  |  Invoke Kutools Functions
Popular Features: Find, Highlight or Identify Duplicates   |  Delete Blank Rows   |  Combine Columns or Cells without Losing Data   |   Round without Formula ...
Super Lookup: Multiple Criteria VLookup    Multiple Value VLookup  |   VLookup Across Multiple Sheets   |   Fuzzy Lookup ....
Advanced Drop-down List: Quickly Create Drop Down List   |  Dependent Drop Down List   |  Multi-select Drop Down List ....
Column Manager: Add a Specific Number of Columns  |  Move Columns  |  Toggle Visibility Status of Hidden Columns  |  Compare Ranges & Columns ...
Featured Features: Grid Focus   |  Design View   |   Big Formula Bar    Workbook & Sheet Manager   |  Resource Library (Auto Text)   |  Date Picker   |  Combine Worksheets   |  Encrypt/Decrypt Cells    Send Emails by List   |  Super Filter   |   Special Filter (filter bold/italic/strikethrough...) ...
Top 15 Toolsets12 Text Tools (Add Text, Remove Characters, ...)   |   50+ Chart Types (Gantt Chart, ...)   |   40+ Practical Formulas (Calculate age based on birthday, ...)   |   19 Insertion Tools (Insert QR Code, Insert Picture from Path, ...)   |   12 Conversion Tools (Numbers to Words, Currency Conversion, ...)   |   7 Merge & Split Tools (Advanced Combine Rows, Split Cells, ...)   |   ... and more
Use Kutools in your preferred language – supports English, Spanish, German, French, Chinese, and 40+ others!

Supercharge Your Excel Skills with Kutools for Excel, and Experience Efficiency Like Never Before. Kutools for Excel Offers Over 300 Advanced Features to Boost Productivity and Save Time.  Click Here to Get The Feature You Need The Most...


Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!

All Kutools add-ins. One installer

Kutools for Office suite bundles add-ins for Excel, Word, Outlook & PowerPoint plus Office Tab Pro, which is ideal for teams working across Office apps.

Excel Word Outlook Tabs PowerPoint
  • All-in-one suite — Excel, Word, Outlook & PowerPoint add-ins + Office Tab Pro
  • One installer, one license — set up in minutes (MSI-ready)
  • Works better together — streamlined productivity across Office apps
  • 30-day full-featured trial — no registration, no credit card
  • Best value — save vs buying individual add-in