Formula required referencing a cell's formula

hsandeep

Well-known Member
Joined
Dec 6, 2008
Messages
1,226
Office Version
  1. 2010
Platform
  1. Windows
  2. Mobile
My Workbook contains 2 worksheets: Sheet1 & Sheet2

In Sheet2: B2=Sheet1!T17

In C2 I want to get value of column A i.e. 'like' =Sheet1!A17...but I don't want to punch this formula. I need a reference formula with respect to cell B2.

Thanks in adv.
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Could not get....
In Sheet2: B2=Sheet1!T17
In C2 I want A17 of Sheet1
 
Upvote 0
If your cell B2 is an actual working formula then I think you need VBA. I thought it contained the text Sheet1!T17 not including the =. I certainly wouldn't know another way other than VBA.
 
Upvote 0
I've borrowed from the thread linked below - the consensus in that thread seemed to be the best way was a VBA function

http://www.mrexcel.com/forum/excel-questions/33170-code-extract-formula-cell.html

Here is a custom function that will return a cell's formula:

Code:
Function CellFormula(Rng As Range) As String
    CellFormula = Rng.Formula
End Function

Paste the code into a General module.

Do the above, then:

C2 =INDIRECT(RIGHT(SUBSTITUTE(cellformula(B2),"!T","!A"),LEN(SUBSTITUTE(cellformula(B2),"!T","!A"))-1))
 
Upvote 0

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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