Function Problems

Automatically Increase an INDEX Number When Copying Down in Excel

Khadija KhanKhadija Khan Nov 25, 2026 870 views

Question details

Automatically increase the index in an Excel formula copied down to display horizontal source data vertically.

Automatically Increase an INDEX Number When Copying Down in Excel
Product
Microsoft Excel
Device & OS
not provided
Scenario
Values in Sheet2 cells D11:U11 need to appear vertically in Sheet1 cells C21:C38.
Observed behavior
Each successive destination cell should return the next value from the horizontal source range.
Before you start

Check that the source values are in Sheet2!D11:U11 and that Sheet1!C21:C38 is available for the results. Adjust the sheet name and ranges in the formula if your workbook uses different locations.

Solution 1Recommended

Use INDEX and ROWS to Return Horizontal Values Vertically

Use this formula when you want each row of a vertical list to return the next cell from a horizontal source range.

ROWS($C$21:C21) starts at 1 and increases as the formula is filled down. INDEX uses that number as the column position within the fixed source range.

1
Enter the formula

On Sheet1, select cell C21 and enter =INDEX(Sheet2!$D$11:$U$11,1,ROWS($C$21:C21)). Press Enter.

2
Fill the formula down

Select C21 and drag its fill handle down to C38. Each cell returns the next value from Sheet2!D11:U11.

3
Check the results

Confirm that C21 displays the value from Sheet2!D11 and C38 displays the value from Sheet2!U11.

Use INDEX and ROWS to Return Horizontal Values Vertically
Keep the ranges aligned: The source range contains 18 cells, so fill the formula into 18 destination rows. Filling farther down returns a #REF! error because the index exceeds the source range.
Work with spreadsheet formulas

Create the Same INDEX and ROWS Formula in WPS Spreadsheets

Use WPS Spreadsheets to enter the INDEX and ROWS formula and fill it down, turning a horizontal source range into a vertical list.

  1. 1. Open the workbook: In WPS Spreadsheets, open the workbook containing Sheet1 and Sheet2.
  2. 2. Enter the formula: Select Sheet1 cell C21 and enter =INDEX(Sheet2!$D$11:$U$11,1,ROWS($C$21:C21)), then press Enter.
  3. 3. Fill down: Drag the fill handle from C21 down to C38 to return the remaining values.
  4. 4. Save the workbook: Choose File > Save to keep the formulas in your workbook.
Automatically advance through horizontal source valuesOpen and edit Microsoft Excel XLSX filesUse familiar spreadsheet formulas and fill controls
microsoft office alternative - wps office

Frequently Asked Questions

Why does the INDEX number increase when I copy the formula down?

ROWS($C$21:C21) counts one row in C21. When copied to C22, it becomes ROWS($C$21:C22), which counts two rows. The first reference stays fixed while the second moves.

What do the dollar signs in the formula do?

The dollar signs in Sheet2!$D$11:$U$11 keep the source range fixed when you fill down. In $C$21:C21, they fix the start of the ROWS range while allowing its end to move.

Why does the formula return a #REF! error?

The index may be larger than the number of cells in the source range. Sheet2!D11:U11 contains 18 cells, so fill the example formula through 18 destination rows, ending at C38.

How do I adapt the formula to a different starting cell?

Replace Sheet2!$D$11:$U$11 with your fixed horizontal source range. If your first destination cell is A5, use ROWS($A$5:A5) as the column index and fill down.