Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Werner Rohrmoser
 
Posts: n/a
Default Indirect used in an array formula

Hello,

Environment: Windows XP SP1 Vers. 5.1.2600
Application: Excel XP SP2

Problem:
I have 4 sheets named "sheet1", "sheet2", "sheet3", "sheet4".
sheet1!A1=1, sheet1!A1=2, sheet1!A1=3.

sheet4!A1=sheet1, sheet4!B1=sheet2, sheet4!C1=sheet3.

sheet4!A2="=INDIRECT(A1 & "!A1")"
sheet4!B2="=INDIRECT(B1 & "!A1")"
sheet4!C2="=INDIRECT(C1 & "!A1")"
This works and I get the right results.

When I try an array formula on sheet4 like {=INDIRECT(A1:C1 & "!A1")}
I get "#VALUE!".
The formula is placed in three horizontal cells and I have entered it
with Ctrl+Shift+Enter.
When I calculate a part of the formula it seems to me that it works, I
get the arrays, which I have expected, but at the end it doesn't work.

Any help would be appreciated.
Thanks.

Regards
Werner

  #2   Report Post  
Héctor Miguel
 
Posts: n/a
Default

hi, Werner !

... 4 sheets... "sheet1", "sheet2", "sheet3", "sheet4"
... sheet1!A1=1, sheet2!A1=2, sheet3!A1=3.
sheet4!A1=sheet1, sheet4!B1=sheet2, sheet4!C1=sheet3.
sheet4!A2="=INDIRECT(A1 & "!A1")"
sheet4!B2="=INDIRECT(B1 & "!A1")"
sheet4!C2="=INDIRECT(C1 & "!A1")"
This works and I get the right results.
When I try an array formula on sheet4 like {=INDIRECT(A1:C1 & "!A1")} I get "#VALUE!".
The formula is placed in three horizontal cells and I have entered it with Ctrl+Shift+Enter.
When I calculate a part of the formula... I get the arrays, which I have expected, but at the end it doesn't work.


FWIW, if you use a range-array, you have to indicate which index from the array goes into each cell
try again with: =index(indirect(a1:c1&"!a1"),{1;2;3})
[placed in three horizontal cells and entered with ctrl+shift+enter]

hth,
hector.


  #3   Report Post  
Werner Rohrmoser
 
Posts: n/a
Default

Thanks,
I use it for a file which has a sheet for every week
of the year (for example week 01-05, week 02-05,....., week 52-05).
On a consolidation sheet I pull data from the week sheets.
At the beginning of a new year a vba-procedure renames my week sheets
according to the current year (for example week 01-06, week 02-06,
etc.),
writes new headers (week 01-06, week 02-06, etc.) for a table in which
these headers are used as a part of my formulas.
To avoid errors and changes by users I like to use array formulas.

In short words: automatic setup for a new year.

Werner

  #4   Report Post  
Werner Rohrmoser
 
Posts: n/a
Default

Hi Hector,

this afternoon I've had another idea and it works as well.
{=3DN(INDIRECT(A1:C1 & "!A1"))} or
in my real case {=3DN(INDIREKT("'" & C1:BE1 & "'!M7"))},
because I have 55 sheets.

Regards
Werner

H=E9ctor Miguel schrieb:
hi, Werner !

... 4 sheets... "sheet1", "sheet2", "sheet3", "sheet4"
... sheet1!A1=3D1, sheet2!A1=3D2, sheet3!A1=3D3.
sheet4!A1=3Dsheet1, sheet4!B1=3Dsheet2, sheet4!C1=3Dsheet3.
sheet4!A2=3D"=3DINDIRECT(A1 & "!A1")"
sheet4!B2=3D"=3DINDIRECT(B1 & "!A1")"
sheet4!C2=3D"=3DINDIRECT(C1 & "!A1")"
This works and I get the right results.
When I try an array formula on sheet4 like {=3DINDIRECT(A1:C1 & "!A1")}=

I get "#VALUE!".
The formula is placed in three horizontal cells and I have entered it w=

ith Ctrl+Shift+Enter.
When I calculate a part of the formula... I get the arrays, which I hav=

e expected, but at the end it doesn't work.

FWIW, if you use a range-array, you have to indicate which index from the=

array goes into each cell
try again with: =3Dindex(indirect(a1:c1&"!a1"),{1;2;3})
[placed in three horizontal cells and entered with ctrl+shift+enter]
=20
hth,
hector.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
referencing the value of a cell containing an array formula KR Excel Worksheet Functions 4 July 5th 05 06:15 PM
problem with Array Formula OrdOff Excel Worksheet Functions 2 June 30th 05 04:57 PM
How can you use count with an array formula similar to using sum PhilH Excel Worksheet Functions 3 June 27th 05 08:00 AM
Trouble shooting#NA error in Array formula RonR Excel Discussion (Misc queries) 2 June 14th 05 09:58 PM
Help with array formula Excel Worksheet Functions 2 January 20th 05 04:17 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"