Automatically Increase an INDEX Number When Copying Down in Excel
Question details
Automatically increase the index in an Excel formula copied down to display horizontal source data vertically.

- 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.
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.
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.
On Sheet1, select cell C21 and enter =INDEX(Sheet2!$D$11:$U$11,1,ROWS($C$21:C21)). Press Enter.
Select C21 and drag its fill handle down to C38. Each cell returns the next value from Sheet2!D11:U11.
Confirm that C21 displays the value from Sheet2!D11 and C38 displays the value from Sheet2!U11.

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. Open the workbook: In WPS Spreadsheets, open the workbook containing Sheet1 and Sheet2.
- 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. Fill down: Drag the fill handle from C21 down to C38 to return the remaining values.
- 4. Save the workbook: Choose File > Save to keep the formulas in your workbook.

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.




