Indirect?

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Indirect?

Post by VegasNath »

How can I change the A1 in the following formula to the cell reference that is stated in B1?

=IF(ISERROR(INDIRECT("'"&TEXT($A10,"dd-mm")&"'!A1"))=TRUE,0,INDIRECT("'"&TEXT($A10,"dd-mm")&"'!A1"))
:wales: Nathan :uk:
There's no place like home.....

User avatar
Don Wells
5StarLounger
Posts: 689
Joined: 27 Jan 2010, 16:45
Location: Ottawa, Ontario, Canada

Re: Indirect?

Post by Don Wells »

Can you not replace "!A1" (including the quotation marks), with INDIRECT(B1)?
Regards
Don

User avatar
mbarron
2StarLounger
Posts: 112
Joined: 25 Jan 2010, 20:19

Re: Indirect?

Post by mbarron »

Does this do what you want?

=IF(ISERROR(INDIRECT("'"&TEXT($A10,"dd-mm")&"'!" & B1))=TRUE,0,INDIRECT("'"&TEXT($A10,"dd-mm")&"'!" & B1))

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Indirect?

Post by VegasNath »

VegasNath wrote:=IF(ISERROR(INDIRECT("'"&TEXT($A10,"dd-mm")&"'!A1"))=TRUE,0,INDIRECT("'"&TEXT($A10,"dd-mm")&"'!A1"))
Finally got there:

=IF(ISERROR(INDIRECT("'"&TEXT($A4,"dd-mm")&"'!A1"))=TRUE,0,INDIRECT("'"&TEXT($A4,"dd-mm")&"'!"&TEXT(B$1,"")&""))


Thanks for the reply Don. :cheers:
:wales: Nathan :uk:
There's no place like home.....

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Indirect?

Post by VegasNath »

Thanks also Mike, i figured it out a short while ago after much frustration!
:wales: Nathan :uk:
There's no place like home.....

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Indirect?

Post by VegasNath »

Out of curiosity:.....

A4 is a date (15/09/10)
W1 = E51:G51
W2 = E57:G57

W4 = =IF(ISERROR(INDIRECT("'"&TEXT($A4,"dd-mm")&"'!A1"))=TRUE,0,SUM(INDIRECT("'"&TEXT($A4,"dd-mm")&"'!"&TEXT(W$1,"")&""),INDIRECT("'"&TEXT($A4,"dd-mm")&"'!"&TEXT(W$2,"")&"")))

This works and provides the sum of E51:G51,E57:G57 from worksheet 15-09

However, Is it possible to concatenate the strings from W1:W2 into "E51:G51,E57:G57" (one cell) and therefore simplify the formula in W4 without having to sum various ranges separately?
:wales: Nathan :uk:
There's no place like home.....

User avatar
rory
5StarLounger
Posts: 818
Joined: 24 Jan 2010, 15:56

Re: Indirect?

Post by rory »

No, because you need the sheet name for each part. The TEXT function is unnecessary though around W1 and W2.
Regards,
Rory

User avatar
VegasNath
5StarLounger
Posts: 1185
Joined: 24 Jan 2010, 12:02
Location: Wales, UK.

Re: Indirect?

Post by VegasNath »

Thanks Rory.
:wales: Nathan :uk:
There's no place like home.....