# 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

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.

##### 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
416
Replies
4
Views
103
Replies
3
Views
91
Replies
3
Views
62
Replies
3
Views
45

1,148,189
Messages
5,745,243
Members
423,937
Latest member
The Great Dane

### 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