Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Indirect Alternatives

I have large numbers of cells which contain a formula as below

=IF(ISERROR(INDIRECT("'" & A2 & "'!C41")),0,INDIRECT("'" & A2 & "'!C41"))

This does exactly what it is supposed to but it definately creates a slower calculation
process when set on automatic calculation which really needs to be on. I checked using
Fastexcel and the block is creating a bottleneck. Is there another alternative to this
which would produce the same result but faster? I would welcome any guidance.

Graham
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1,231
Default Indirect Alternatives

Graham H wrote...
....
=IF(ISERROR(INDIRECT("'" & A2 & "'!C41")),0,INDIRECT("'" & A2 & "'!C41"))


Are you using an ISERROR check to avoid #REF! errors when cell A2
doesn't contain the name of a worksheet in an open workbook or to
catch errors in the cells in the other worksheets?

. . . Is there another alternative to this
which would produce the same result but faster? I would welcome any guidance.


Maybe. If you're working with just a few other worksheets (say A, B, C
and D), you could try something like this. Define the following names.

Aws =A!$1:$65536
Bws =B!$1:$65536
Cws =C!$1:$65536
Dws =D!$1:$65536
_WS =CHOOSE(MATCH($A$2,{"A";"B";"C";"D"},0),Aws,Bws,Cw s,Dws)

Then replace your formula above with

=IF(ISERROR(INDEX(_WS,41,3)),0,INDEX(_WS,41,3))

or without the hardcoding

=IF(ISERROR(INDEX(_WS,ROW(C41),COLUMN(C41))),0,IND EX(_WS,ROW
(C41),COLUMN(C41)))

This will eliminate volatile function calls, which should speed things
up.
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Indirect Alternatives

Thanks Harlan,
The ISERROR is being used to avoid the #REF! error when cell A2 doesn't
contain the name of the worksheet.

The problem is with the worksheets in that both the number and name of the worksheets will
be unknown. What I am trying to say is that as part of the workbook someone lists down a
range of fields (land) which they have with whatever name they choose to call them. The
number of fields and subsequently worksheets can be variable but the workbook then
creates a worksheet for every field with the name of the worksheet being the name of the
field. The formula then links to A2 which is the name of the first worksheet. Hope this is
making some sense.

Graham

Harlan Grove wrote:
Graham H wrote...
...
=IF(ISERROR(INDIRECT("'" & A2 & "'!C41")),0,INDIRECT("'" & A2 & "'!C41"))


Are you using an ISERROR check to avoid #REF! errors when cell A2
doesn't contain the name of a worksheet in an open workbook or to
catch errors in the cells in the other worksheets?

. . . Is there another alternative to this
which would produce the same result but faster? I would welcome any guidance.


Maybe. If you're working with just a few other worksheets (say A, B, C
and D), you could try something like this. Define the following names.

Aws =A!$1:$65536
Bws =B!$1:$65536
Cws =C!$1:$65536
Dws =D!$1:$65536
_WS =CHOOSE(MATCH($A$2,{"A";"B";"C";"D"},0),Aws,Bws,Cw s,Dws)

Then replace your formula above with

=IF(ISERROR(INDEX(_WS,41,3)),0,INDEX(_WS,41,3))

or without the hardcoding

=IF(ISERROR(INDEX(_WS,ROW(C41),COLUMN(C41))),0,IND EX(_WS,ROW
(C41),COLUMN(C41)))

This will eliminate volatile function calls, which should speed things
up.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8,856
Default Indirect Alternatives

The ISERROR is being used to avoid the #REF! error when cell A2 doesn't
contain the name of the worksheet


In that case you could just use:

=IF(A2="", 0,INDIRECT("'" & A2 & "'!C41"))

and this should speed things up considerably.

Hope this helps.

Pete

On Jan 15, 10:24*pm, Graham H wrote:
Thanks Harlan,
* * * * * * * * The ISERROR is being used to avoid the #REF! error when cell A2 doesn't
contain the name of the worksheet.

The problem is with the worksheets in that both the number and name of the worksheets will
be unknown. What I am trying to say is that as part of the workbook someone lists down a
range of fields (land) which they have with whatever name they choose to call them. The
number of fields and subsequently worksheets can be variable but the workbook *then
creates a worksheet for every field with the name of the worksheet being *the name of the
field. The formula then links to A2 which is the name of the first worksheet. Hope this is
making some sense.

Graham



Harlan Grove wrote:
Graham H wrote...
...
=IF(ISERROR(INDIRECT("'" & A2 & "'!C41")),0,INDIRECT("'" & A2 & "'!C41"))


Are you using an ISERROR check to avoid #REF! errors when cell A2
doesn't contain the name of a worksheet in an open workbook or to
catch errors in the cells in the other worksheets?


. . . Is there another alternative to this
which would produce the same result but faster? I would welcome any guidance.


Maybe. If you're working with just a few other worksheets (say A, B, C
and D), you could try something like this. Define the following names.


Aws * *=A!$1:$65536
Bws * *=B!$1:$65536
Cws * *=C!$1:$65536
Dws * *=D!$1:$65536
_WS * *=CHOOSE(MATCH($A$2,{"A";"B";"C";"D"},0),Aws,Bws,C ws,Dws)


Then replace your formula above with


=IF(ISERROR(INDEX(_WS,41,3)),0,INDEX(_WS,41,3))


or without the hardcoding


=IF(ISERROR(INDEX(_WS,ROW(C41),COLUMN(C41))),0,IND EX(_WS,ROW
(C41),COLUMN(C41)))


This will eliminate volatile function calls, which should speed things
up.- Hide quoted text -


- Show quoted text -


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 56
Default Indirect Alternatives

Many thanks to all for their help. It is most appreciated.

Graham

Pete_UK wrote:
The ISERROR is being used to avoid the #REF! error when cell A2 doesn't
contain the name of the worksheet


In that case you could just use:

=IF(A2="", 0,INDIRECT("'" & A2 & "'!C41"))

and this should speed things up considerably.

Hope this helps.

Pete

On Jan 15, 10:24 pm, Graham H wrote:
Thanks Harlan,
The ISERROR is being used to avoid the #REF! error when cell A2 doesn't
contain the name of the worksheet.

The problem is with the worksheets in that both the number and name of the worksheets will
be unknown. What I am trying to say is that as part of the workbook someone lists down a
range of fields (land) which they have with whatever name they choose to call them. The
number of fields and subsequently worksheets can be variable but the workbook then
creates a worksheet for every field with the name of the worksheet being the name of the
field. The formula then links to A2 which is the name of the first worksheet. Hope this is
making some sense.

Graham



Harlan Grove wrote:
Graham H wrote...
...
=IF(ISERROR(INDIRECT("'" & A2 & "'!C41")),0,INDIRECT("'" & A2 & "'!C41"))
Are you using an ISERROR check to avoid #REF! errors when cell A2
doesn't contain the name of a worksheet in an open workbook or to
catch errors in the cells in the other worksheets?
. . . Is there another alternative to this
which would produce the same result but faster? I would welcome any guidance.
Maybe. If you're working with just a few other worksheets (say A, B, C
and D), you could try something like this. Define the following names.
Aws =A!$1:$65536
Bws =B!$1:$65536
Cws =C!$1:$65536
Dws =D!$1:$65536
_WS =CHOOSE(MATCH($A$2,{"A";"B";"C";"D"},0),Aws,Bws,Cw s,Dws)
Then replace your formula above with
=IF(ISERROR(INDEX(_WS,41,3)),0,INDEX(_WS,41,3))
or without the hardcoding
=IF(ISERROR(INDEX(_WS,ROW(C41),COLUMN(C41))),0,IND EX(_WS,ROW
(C41),COLUMN(C41)))
This will eliminate volatile function calls, which should speed things
up.- Hide quoted text -

- Show quoted text -


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
COUNTIF limitations, alternatives? Steve Excel Discussion (Misc queries) 5 November 18th 07 07:20 PM
Alternatives to GET.CELL and VB? whitehurst Excel Worksheet Functions 9 May 24th 06 08:50 PM
What are the alternatives ??? christopherp Excel Discussion (Misc queries) 4 March 19th 06 02:39 PM
Alternatives to Excel Spider Excel Discussion (Misc queries) 2 March 1st 05 01:03 PM


All times are GMT +1. The time now is 03:28 PM.

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

About Us

"It's about Microsoft Excel"