How to Create a Dynamic VLOOKUP Column Range in Excel & WPS
Question details
The user needs a dynamic way to return multiple consecutive columns using a formula without manually typing each column index number.

- Product
- Spreadsheets
- Device & OS
- not provided
- Scenario
- Mapping or extracting a large number of consecutive columns (e.g., hundreds or thousands of columns) for a single record from a source sheet to a destination sheet.
- Observed behavior
- Using standard VLOOKUP requires entering column numbers manually, which is difficult and time-consuming for large datasets.
Verify that your spreadsheet software supports Dynamic Arrays and the SEQUENCE function, and ensure that the destination cells adjacent to your formula are empty to avoid a #SPILL! error.
Use VLOOKUP Combined with the SEQUENCE Function
The SEQUENCE function can generate an array of sequential numbers automatically, acting as a dynamic column index for VLOOKUP.
Instead of typing a hardcoded array like {2,3,4,5}, you can use SEQUENCE to define how many columns to return and where to start.
The syntax for SEQUENCE is SEQUENCE(rows, columns, [start], [step]). For a row of column numbers, you will define 1 row and the required number of columns.
Click on the cell where you want the first matched value to appear.
Type your formula using SEQUENCE in the third argument. For example, to return 10 consecutive columns starting from column 2, use: =VLOOKUP(A2, Data!A:Z, SEQUENCE(1, 10, 2), FALSE).
Press Enter. The formula will calculate and automatically spill the data across the next 10 columns to the right.

Use XLOOKUP to Return Multiple Columns Natively
XLOOKUP is a modern alternative to VLOOKUP that can return an entire row or multiple columns without needing a column index number.
Effortlessly Manage Large Datasets with WPS Spreadsheet
WPS Spreadsheet fully supports advanced functions like VLOOKUP, XLOOKUP, and dynamic arrays including SEQUENCE, allowing you to quickly process huge ranges of columns.
- 1. Open WPS Spreadsheet: Launch WPS Office and open your workbook containing the large dataset.
- 2. Access the Formula Tab: Navigate to the Formulas tab to explore the function library and ensure dynamic arrays are active.
- 3. Apply your Dynamic Lookup: Type your =VLOOKUP(..., SEQUENCE(...)) or =XLOOKUP() formula directly into the destination cell.
- 4. Extract the Data: Press Enter, and watch your data spill dynamically across multiple consecutive columns.

Frequently Asked Questions
Why does my dynamic VLOOKUP formula return a #SPILL! error?
A #SPILL! error occurs when the formula attempts to populate multiple consecutive columns, but one or more of the destination cells already contain data. To fix this, simply delete the data or text blocking the spill range.
Is it better to use VLOOKUP or XLOOKUP for mapping 1,000 columns?
XLOOKUP is generally better for this task. It eliminates the need for calculating column index numbers and handles wide return arrays inherently, making the formula less prone to breaking if columns are inserted or deleted in the source data.
Can I use Power Query instead of formulas for massive column extraction?
Yes. If you are merging data that contains hundreds or thousands of columns, using Power Query to merge queries is much more performance-friendly. Formulas calculating 1,000 array instances simultaneously can drastically slow down your workbook.
Are dynamic array formulas like SEQUENCE compatible with older spreadsheet versions?
No, the SEQUENCE function and dynamic arrays are available only in modern spreadsheet software (like Microsoft 365, Excel 2021, and the latest versions of WPS Office). For older versions, you may need to use a combination of INDEX, MATCH, and the COLUMNS function.




