Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Returning cell values from other sheets by referencing sheet names from a list

I have a spreadsheet with approx twenty different sheets named by stock ticker. Because these are templates, the information in each sheet is found in the same cells. For example, the EPS for the current year is always in cell A55 regardless of the sheet.

I want to build a summary sheet that will pull data from the templates based on the tickers. So envision a summary sheet with tickers (also sheet names) down column A and formulas in columns B to reference the same position in each different sheet in the list.

I know I can build out one row and then simply copy it down and do Find/Replace for each sheet name/ticker, but it seems I should be able to automate the formulas so these know to look at column A, then go to the sheet with that name, then return the data that is referenced in the formula. This would make it much easier to add sheets/tickers as time went on. I have tried =INDIRECT without success.

How do I get the formulas to reference column A in the summary sheet so that these know in which template/sheet to look up the information?

like image 590
user3217303 Avatar asked Jan 21 '14 01:01

user3217303


2 Answers

Please try:

=INDIRECT(A1&"!A55")

Regarding Alaa M's Comment and Xenix Chroptl's Answer, spaces in the sheet name are handled, though extra quotes are required:

=INDIRECT("'"&A1&"'!A55")
like image 166
pnuts Avatar answered Oct 16 '22 07:10

pnuts


EDIT:

This answer did not really help, but I will leave this for anyone in the future wondering how use the INIDRECT() formula, in a SUM() formula as an example. If you wanted to sum column B in Sheet1, then you would do something like this:

=SUM(INDIRECT(A1&"!B:B"))

The contents of cell A1 being "Sheet1", then drag and fill into the other rows

like image 24
binaryfunt Avatar answered Oct 16 '22 07:10

binaryfunt