# Index Worksheet Function

#### gnaga

##### Well-known Member
Hi,

I am using Index Function in arrray formula.My formula is as follows

{=Index(A1:D3,A4)}

A4 is housing a number 2

I am entering this formula in the range of
E1:E4

It suppose to return the value of A2:D2 asper excel doumentation. But it is repeating the value of A2 in all the cells in the range of E1:E4.

If my understanding is right then why it is not returning the value? Otherwise what is it I am missing?

GNaga

### Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.

##### MrExcel MVP
In E1 enter & copy down as far as needed:

=INDEX(\$A\$1:\$D\$3,\$A\$4,ROW(1:1))

#### gnaga

##### Well-known Member
Aladin Can you please explain what is the wrong in my formula? Asper excel help documentation if we omit column number it suppose to return the entire row.

When I omit the row number the entire column values are returned in the target range.

Thank you

GNaga

##### MrExcel MVP
On 2002-09-29 06:59, gnaga wrote:
Aladin Can you please explain what is the wrong in my formula? Asper excel help documentation if we omit column number it suppose to return the entire row.

When I omit the row number the entire column values are returned in the target range.

Thank you

GNaga

If you insist on an array-entered version, then you need to set up the formula as either

=INDEX(A1:D3,A4,)

or

=INDEX(A1:D3,A4,0)

and array-enter it in a 4-cell horizontal range.

If you insist having 4 values in row 2 of the original set in a vertical range, you need set up the formula as:

=TRANSPOSE(INDEX(A1:D3,A4,0))

and array-enter in a 4-cell vertical range.

What all this boils down to is that you need to transpose when you want to go from a horizontal to a vertical range (or vice versa).

Note that what I proposed in my initial reply is not an array formula.

EDIT for typo...
This message was edited by Aladin Akyurek on 2002-09-29 07:54

Replies
4
Views
410
Replies
3
Views
57
Replies
4
Views
130
Replies
4
Views
266
Replies
8
Views
492

1,147,748
Messages
5,742,978
Members
423,769
Latest member
LongToast

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.

### Which adblocker are you using?

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back