Solved

Using Cell Reference as Worksheet Name

Posted on 2013-12-02
6
340 Views
Last Modified: 2013-12-02
I have a spreadsheet that I have created to track totals for various worksheets in a workbook. Each time I add a new worksheet to the workbook I have to set up a series of formulas on a summary page to pull information from the newly created worksheet. To do that I have to manually type my new worksheet name into the formula each time. What I want to know is there a way to use a cell reference to populate the worksheet name rather than typing it in each time.

Here is one of my formulas which is in cell B3 on my summary worksheet.

=INDEX('Sheet'!$B$11:$B$100001, COUNTA('Sheet1'!$B$11:$B$100001), 1)

However in A3 of that same sheet I have the worksheet name, Sheet1, entered. What I would like to do is use a cell reference that would translate through the formula as "Sheet1" but everything I have tried has returned a #Ref! error. For example:

=INDEX('"3"'!$B$11:$B$100001, COUNTA('"A3"'!$B$11:$B$100001), 1)

does not work. I have tried several different variations of this same thing but everything I try returns the exact same error message.

Is this doable or is it impossible?
0
Comment
Question by:gacto
6 Comments
 
LVL 23

Accepted Solution

by:
NBVC earned 500 total points
ID: 39690943
Try:

=INDEX(INDIRECT("'"&A3&"'!$B$11:$B$100001"), COUNTA(INDIRECT("'"&A3&"'!$B$11:$B$100001")), 1)
0
 
LVL 43

Expert Comment

by:Saqib Husain, Syed
ID: 39690987
This formula will give the sheet name in a saved file.

=REPLACE(CELL("filename"),1,FIND("]",CELL("filename")),"")
0
 
LVL 32

Expert Comment

by:Rob Henson
ID: 39691102
Slight addition to ssaquibh's suggestion.

On each sheet use:

=REPLACE(CELL("filename",A1),1,FIND("]",CELL("filename",A1)),"")

That will then give the sheet name for that sheet whereas previously the formula would give the sheet name for the active sheet.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 32

Expert Comment

by:Rob Henson
ID: 39691120
I have also something similar previously with the MID function.

On your summary sheet, are the sheet names hard coded or formula driven. If hard coded and the sheet name of the source sheet changes, the INDEX formula above won't be able to find the sheet and will give an error.

You can use this in cell A3 where your current sheet name is:

=REPLACE(CELL("filename",Sheet1!$A$1),1,FIND("]",CELL("filename",Sheet1!$A$1)),"")

The reference to sheet1 will then change with a change in sheet name and the calculated result would be the new sheet name, a self fulfilling prophecy as Wizards would say!

Thanks
Rob H
0
 

Author Closing Comment

by:gacto
ID: 39691165
Thanks for the quick response nb_vc.
0
 

Author Comment

by:gacto
ID: 39691173
robhenson,

my sheet names are hard coded but you bring up an interesting point. I will post another question to determine how to implement your suggestion. I do not know how to write the formula to populate my cell references with the sheet names. Ultimately this workbook will have new worksheets added on a regular basis so your suggestion will be extremely helpful.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Freeze panes is an option within all variants of Excel to enable parts of a sheet to remain stationary when the cursor is in another part of the sheet. This is a very useful feature which is overlooked or under used.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now