Function Problems

How to Automatically Insert Multiple Rows for Each Country in Excel

Tauseeq MagsiTauseeq Magsi Oct 12, 2026 871 views

Question details

The user needs to automatically generate a specific number of duplicated rows (e.g., 36 rows) for a list of categories (e.g., countries) without having to manually insert them.

How to Automatically Insert Multiple Rows for Each Country in Excel
Product
Excel
Device & OS
not provided
Scenario
Expanding a dataset by repeating each item in a list a set number of times for data entry, sequencing, or analysis purposes.
Observed behavior
Currently, creating repeated rows for a large list requires manual insertion and copying, which is time-consuming and inefficient for 90+ items.
Before you start

Verify your Excel version before proceeding, as the most efficient formula method requires Microsoft 365 or Excel 2021 and later. Always keep a backup copy of your original list before applying bulk data transformations.

Solution 1Recommended

Use REDUCE and VSTACK Dynamic Array Formula

This is the fastest method for modern Excel versions to automatically repeat items a specific number of times dynamically.

Dynamic array formulas can process an entire range of data and output the expanded results into a new column instantly. The REDUCE function iterates over your original list, while EXPAND and VSTACK duplicate and stack the rows.

1
Select an output cell

Click on an empty cell where you want the new, expanded list to begin. Ensure there is enough empty space below it so the formula does not return a #SPILL! error.

2
Enter the duplication formula

Type the formula: =DROP(REDUCE("",A2:A91,LAMBDA(a,b,VSTACK(a,EXPAND(b,36,,b)))),1)

3
Adjust the parameters

Change 'A2:A91' in the formula to match the actual range of your country list. Change '36' to the exact number of rows you need for each country.

4
Apply the formula

Press Enter. The formula will automatically generate the complete list with each country repeated the specified number of times.

Use REDUCE and VSTACK Dynamic Array Formula
Version Compatibility: This formula requires Microsoft 365 or a newer version of Excel. If you see a #NAME? error, your version does not support these dynamic array functions.
Spreadsheet Automation

Easily Manage Large Datasets in WPS Spreadsheet

WPS Spreadsheet offers powerful data handling capabilities and full compatibility with Excel files, allowing you to easily duplicate rows, sort data, and apply formulas for free.

  1. 1. Open your dataset: Launch WPS Spreadsheet and open the document containing your list of items.
  2. 2. Duplicate the list: Copy your source list and paste it directly underneath as many times as the rows you need.
  3. 3. Group items via sorting: Navigate to the Data tab on the top ribbon and use the Sort (A-Z) feature to instantly group identical items together.
  4. 4. Add a sequence: Type 1 and 2 next to your first item, highlight them, and double-click the bottom-right corner of the cell to autofill the sequence down the column.
Free and lightweight alternative to Microsoft ExcelFully compatible with .xlsx, .xls, and .csv formatsSupports advanced data sorting, filtering, and arraysUser-friendly interface for seamless bulk data manipulation
microsoft office alternative - wps office

Frequently Asked Questions

Why does my dynamic array formula show a #NAME? error?

This error occurs if your version of Excel does not support newer functions like VSTACK or REDUCE. You will need to upgrade to Microsoft 365, use Excel on the web, or use the copy-and-sort method instead.

Can I use a macro (VBA) to insert multiple rows for each item?

Yes, you can write a VBA script using a 'For' loop to iterate through your list and insert rows dynamically. This is a great alternative if you frequently need to perform this exact formatting task on large datasets.

How do I add a sequential number (1 to 36) next to each repeated country?

If you used the manual sort method, type 1 and 2 in a new column next to the first country's rows, highlight both cells, and double-click the fill handle to copy the pattern. If you are using formulas, you can combine the SEQUENCE function with your dynamic array.