formula using sheet name

Duane

Board Regular
Joined
Mar 14, 2002
Messages
229
Hey folks,

I think I've seen this but can't find it...

I've got a table on sheet1 that has a list of names running from B2:B12. Each name has its own sheet with the same name.

I want to create a formula in C2 that allows me to copy down to C12 by going to the same cell on each sheet for each name.

I tried variations of =("'"&B2&"'"&"!"$E$22) but to no avail.

Thanks to whoever can come up with this.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Dereks answer should work.
Are you, by any chance, trying to get data from another workbook??

regards Tommy
 
Upvote 0
In you orginal question your referencing $E$22 on sheet1 of the book, in Derek's formula:

=INDIRECT(B2&"!$E$22")
it's looking for the name in B2 & "!$E$22"

i.e. Sheet2!$E$22

as in at E22 on sheet2. is this what you need, if not use

=INDIRECT(B2&"!"&$E$22)

this still wouldn't make any difference to the ref error.

Check to see if:

a: the name is exactly as the sheet name you want

b: there are no spaces before or after the names in the cells.
 
Upvote 0
Hey fellas,

It's the strangest thing... When I use a name that is one word, such as "James", and name the sheet the same, Derek's formula works.

When I name it the full name, as in "James Bond" it gives me the error - what, does Excel not like 007?!
This message was edited by Duane on 2002-04-04 11:07
 
Upvote 0
On 2002-04-04 11:01, Duane wrote:
Hey fellas,

It's the strangest thing... When I use a name that is one word, such as "James", and name the sheet the same, Derek's formula works.

When I name it the full name, as in "James Bond" it gives me the error - what, does Excel not like 007?!
This message was edited by Duane on 2002-04-04 11:07

Try:

=INDIRECT("'"&B2&"'!E22")

Aladin
 
Upvote 0
Thanks to all of you, the mistake was mine, in that I referenced the wrong cell (should have been E2, not E22).

I got it working using both =INDIRECT("'"&B2&"'!E2") and =INDIRECT(B2&"!$E$22")

Much thanks!
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,113,998
Members
448,539
Latest member
alex78

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