0
votes

Using Google Sheets or Excel:

I have columns (B) with Stock symbols, e.g.: B2=GOOG, B3=AAPL, B4= MSFT

I have Sheets named with these same stock symbols respectively. Eg: Sheet2: GOOG, Sheet3: AAPL, etc

I have a formula on Sheet1 that does some computation using data in other sheets. Eg: K2=((GOOG!B2+GOOG!B5)/GOOG!B24)

----I want to automate grabbing the correct sheet name based on column B without manually typing in the sheet name into this formula.----

Is there a way to input the sheet name in this formula K2=((GOOG!B2+GOOG!B5)/GOOG!B24) based on column B in sheet1?

Conceptually something like K2=((*indirectB2*!B2+*indirectB2*!B5)/*indirectB2*!B24)

In other words, how does one input a sheet name into a formula based on a string in a column

My example image is a tad different than mentioned above but same idea:

enter image description here

2
You should use the INDIRECT function - stackoverflow.com/questions/14850828/…Razvan

2 Answers

1
votes

I solved this using =INDIRECT("'"&B4&"'!$B$2")+INDIRECT("'"&B4&"'!$B$5"))/INDIRECT("'"&B4&"'!$B$24")

0
votes

Would K4=((B4&!C43+B4&!B5)/B4&!B24) work?