Get value by referencing a cell

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,213
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
In E2 of Worksheet “Sheet2” I am using a formula =’7’!H120 which gives me value of cell H120 of the Worksheet with tab named ‘7” as a result in cell E2.

This formula in E2 is variable…it can be =’7’!B100; or =’7’!C555 or any formula like this.
I require an Excel formula in cell E3 of Worksheet “Sheet2” which should give me value of the cell which is $G$2 row below or above (IF G2=1, then 1 row below, IF $G$2=-1, then 1 row above) of the cell address which is being used in cell E2.
G2= an integer value

How to accomplish?
Thanks in advance.



Cross posted in Get value by referencing a cell
Referencing.xlsx
EFG
2221
3999
Sheet2
Cell Formulas
RangeFormula
E2E2='7'!H120
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Hi,
Not sure to fully understand ...
May be the first step is
Excel Formula:
=SUBSTITUTE(FORMULATEXT(E2),"='7'!","")
 
Upvote 0
@James006
OP's profile says Excel 2010 so they would not have access to the FORMULATEXT function.
 
Upvote 0
This is solved using vba provided by Peter SS
As a matter of interest, where did I do that?

In the other forum you wrote:
the Excel formula required should be able to read the formula of cell E2 ...
If you are using Excel 2010 as your profile says, a normal worksheet formula cannot read the formula in another cell. Such a function only became available in Excel 2013.
 
Last edited:
Upvote 0
With Excel 2010, you should create a Named Range, say, reference and define it with Refers To : =GET.CELL(6,Sheet2!$E$2)

Then wherever you need your result, you can use
Excel Formula:
=INDIRECT("'7'!"&SUBSTITUTE(SUBSTITUTE(reference,0,1),"='7'!",""))
 
Upvote 0
With Excel 2010, you should create a Named Range, say, reference and define it with Refers To : =GET.CELL(6,Sheet2!$E$2)
Don't know if it will be an issue for the OP, but that method is like a pseudo-macro and the workbook will need to be saved as a macro-enabled workbook.
 
Upvote 0
Don't know if it will be an issue for the OP, but that method is like a pseudo-macro and the workbook will need to be saved as a macro-enabled workbook.
Unless OP saves his workbook using: Excel 97 - 2003 Workbook (*.xls)
 
Upvote 0
Upvote 0

Forum statistics

Threads
1,214,523
Messages
6,120,047
Members
448,940
Latest member
mdusw

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