Problem with the INDEX function

Hansoh

New Member
Joined
Feb 20, 2002
Messages
10
could someone help with this problem?

let's say i have a 10X10 array that i've named ARRAY.

i'm using an INDEX call that references the array:
=INDEX(ARRAY,1,1). this works correctly and returns '1000' as a value.

however, when i use the following function:
=INDEX(G17,1,1) {G17 contains the word 'Array'), the function doesn't work. it returns 'Array'. i thought using G17 in the first argument (G17 contains the word 'Array'), would reference the array named 'Array', not the actual cell G17 itself. how do i fix this?

when i use the following function:
=INDEX(vlookup(x,x:x,1),1,1) where the function vlookup(x,x:x,1) returns 'Array', the index function doesn't work at all; it returns #VALUE!.

the bottomline is this; i need an INDEX function that's flexible enough so that the first argument (the INDEX function looks like this by the way: =INDEX(array, row_num, column_num) can be vary based on certain conditions. for example, if user chooses X, the 1st argument references Array, if user chooses Y, the 1st argument references Array1, etc, etc.


please help.



han
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
On 2002-03-01 06:04, Hansoh wrote:
could someone help with this problem?

let's say i have a 10X10 array that i've named ARRAY.

i'm using an INDEX call that references the array:
=INDEX(ARRAY,1,1). this works correctly and returns '1000' as a value.

however, when i use the following function:
=INDEX(G17,1,1) {G17 contains the word 'Array'), the function doesn't work. it returns 'Array'. i thought using G17 in the first argument (G17 contains the word 'Array'), would reference the array named 'Array', not the actual cell G17 itself. how do i fix this?

when i use the following function:
=INDEX(vlookup(x,x:x,1),1,1) where the function vlookup(x,x:x,1) returns 'Array', the index function doesn't work at all; it returns #VALUE!.

the bottomline is this; i need an INDEX function that's flexible enough so that the first argument (the INDEX function looks like this by the way: =INDEX(array, row_num, column_num) can be vary based on certain conditions. for example, if user chooses X, the 1st argument references Array, if user chooses Y, the 1st argument references Array1, etc, etc.


please help.



han

Han,

If what INDEX retrieves is a name that references a range, you should apply INDIRECT on the result INDEX retrives: Not sure but in your case it should be somthing like:

INDIRECT(INDEX(G17,1,1)) as part of a formula where you need the range.

Otherwise, describe your problem a bit more(without invoking formulas that you use, if you can).

Aladin
 
Upvote 0

Forum statistics

Threads
1,223,350
Messages
6,171,590
Members
452,412
Latest member
sprichwort

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.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

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

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

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
Back
Top