ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   INDEX function (array type) (https://www.excelbanter.com/excel-worksheet-functions/240961-index-function-array-type.html)

Sean[_3_]

INDEX function (array type)
 
Maybe I'm missing a trick here.

The formula =INDEX({1,2,3},1,2) will return the value 2

The formula =INDEX(A1,1,2) where the cell A1 contains the array
constant ={1,2,3} will return a #REF! error

Why does this happen and what is wrong with referencing a array in a
cell?

Sean Timmons

INDEX function (array type)
 
you are referencing values rather than hard-coding them. In this case, the
values are treated as text rather than an array. There's usually an easier
way around this issue if you're trying to calculate something...

"Sean" wrote:

Maybe I'm missing a trick here.

The formula =INDEX({1,2,3},1,2) will return the value 2

The formula =INDEX(A1,1,2) where the cell A1 contains the array
constant ={1,2,3} will return a #REF! error

Why does this happen and what is wrong with referencing a array in a
cell?


Shane Devenshire[_2_]

INDEX function (array type)
 
Hi,

the arguments 1 and 2 in both examples refers to the first row, second
column. Now the second column when referencing a spreadsheet cell is one
column to the right of the reference, here with A1:B1 as the reference, B1 is
the second column. Excel does not look inside of the cell and take the
second entry.

There is also a second issue, since A1 is a one column reference asking for
the second column is asking for a column outside the reference range, again
that is column B

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Sean" wrote:

Maybe I'm missing a trick here.

The formula =INDEX({1,2,3},1,2) will return the value 2

The formula =INDEX(A1,1,2) where the cell A1 contains the array
constant ={1,2,3} will return a #REF! error

Why does this happen and what is wrong with referencing a array in a
cell?


Sean[_4_]

INDEX function (array type)
 
I understand what you're saying Shane, however I an trying to use the
Array form of the INDEX() function and not the Reference form.


Sean

On Aug 27, 9:42*pm, Shane Devenshire
wrote:
Hi,

the arguments *1 and 2 in both examples refers to the first row, second
column. *Now the second column when referencing a spreadsheet cell is one
column to the right of the reference, here with A1:B1 as the reference, B1 is
the second column. *Excel does not look inside of the cell and take the
second entry. *

There is also a second issue, since A1 is a one column reference asking for
the second column is asking for a column outside the reference range, again
that is column B

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire

"Sean" wrote:
Maybe I'm missing a trick here.


The formula *=INDEX({1,2,3},1,2) will return the value 2


The formula *=INDEX(A1,1,2) where the cell A1 contains the array
constant ={1,2,3} will return a #REF! error


Why does this happen and what is wrong with referencing a array in a
cell?



Sean[_4_]

INDEX function (array type)
 
Yes, there probably is an easier way around this but that doesn't
solve my primary dilemma.

If (as you say )the Array constant in cell A1 is being treated as text
instead of an array, is there a way to force it to be treated as such.
Something like what the INDIRECT() function does for address strings?

S.



On Aug 27, 9:25*pm, Sean Timmons
wrote:
you are referencing values rather than hard-coding them. In this case, the
values are treated as text rather than an array. *There's usually an easier
way around this issue if you're trying to calculate something...

"Sean" wrote:
Maybe I'm missing a trick here.


The formula *=INDEX({1,2,3},1,2) will return the value 2


The formula *=INDEX(A1,1,2) where the cell A1 contains the array
constant ={1,2,3} will return a #REF! error


Why does this happen and what is wrong with referencing a array in a
cell?




All times are GMT +1. The time now is 09:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com