Referencing a referenced cell

Sheet1!C4 contains the formula =Sheet2!A1

I want Sheet1!D4 to find out what cell Sheet1!C4 is referencing an
then return the value two columns over.  (Offset will take care o
returning the value two columns over).  My problem is I need to kno
which cell Sheet1!C$ is referencing.  If I use the formul
"=OFFSET(Sheet1!C4,0,1)"  I get the value from one column to the righ
of Sheet1!C4,  I need the value of one column to the right of the cel
being referenced by Sheet1!C4, (Sheet2!A1)    How would I do this.

--
Message posted from http://www.ExcelForum.com

0
7/14/2004 7:48:23 PM
excel 39879 articles. 2 followers. Follow

2 Replies
831 Views

Similar Articles

[PageSpeed] 36

Hi
see your post in Excel.misc

--
Regards
Frank Kabel
Frankfurt, Germany


> Sheet1!C4 contains the formula =Sheet2!A1
>
> I want Sheet1!D4 to find out what cell Sheet1!C4 is referencing and
> then return the value two columns over.  (Offset will take care of
> returning the value two columns over).  My problem is I need to know
> which cell Sheet1!C$ is referencing.  If I use the formula
> "=OFFSET(Sheet1!C4,0,1)"  I get the value from one column to the
right
> of Sheet1!C4,  I need the value of one column to the right of the
cell
> being referenced by Sheet1!C4, (Sheet2!A1)    How would I do this.?
>
>
> ---
> Message posted from http://www.ExcelForum.com/

0
frank.kabel (11126)
7/14/2004 9:39:22 PM
If C4 will only contain a reference, you can use this UDF:

    Public Function OffsetRef(rRange As Range, _
              Optional nRows As Long = 0, _
              Optional nCols As Long = 0) As Variant
        Dim rBase As Range
        Dim bValidRef As Boolean
        
        If rRange.Count = 1 And rRange.HasFormula Then
           On Error Resume Next
           Set rBase = Range(Mid(rRange.Formula, 2))
           On Error GoTo 0
           If Not rBase Is Nothing Then
              With rBase
                 bValidRef = ((.Row + nRows) <= .Parent.Rows.Count) And _
                      ((.Row + nRows) > 0) And _
                      ((.Column + nCols) <= .Parent.Columns.Count) And _
                      ((.Column + nCols) > 0)
                 If bValidRef Then OffsetRef = .Offset(nRows, nCols)
              End With
           End If
        End If
        If Not bValidRef Then OffsetRef = CVErr(xlErrRef)
     End Function
    

Call as

    =OffsetRef(C4,0,2)
    
If you're not familiar with UDFs, take a look at David McRitchie's 
"Getting Started with Macros and User Defined Functions":

    http://www.mvps.org/dmcritchie/excel/getstarted.htm



In article <bryanfox.19eg2l@excelforum-nospam.com>,
 bryanfox <<bryanfox.19eg2l@excelforum-nospam.com>> wrote:

> Sheet1!C4 contains the formula =Sheet2!A1
> 
> I want Sheet1!D4 to find out what cell Sheet1!C4 is referencing and
> then return the value two columns over.  (Offset will take care of
> returning the value two columns over).  My problem is I need to know
> which cell Sheet1!C$ is referencing.  If I use the formula
> "=OFFSET(Sheet1!C4,0,1)"  I get the value from one column to the right
> of Sheet1!C4,  I need the value of one column to the right of the cell
> being referenced by Sheet1!C4, (Sheet2!A1)    How would I do this.?
> 
> 
> ---
> Message posted from http://www.ExcelForum.com/
0
jemcgimpsey (6723)
7/14/2004 10:04:06 PM
Reply:

Similar Artilces:

counting cells with a formula
hi, I want to count cells with a specific value. I don't know how i can put this in a formula, can anybody help me with this problem. regards, ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~ View and post usenet messages directly from http://www.ExcelForum.com/ solo_razor wrote: > hi, > > I want to count cells with a specific value. I don't know how i can > put this in a formula, can anybody help me with this problem. > > regards, > > > > ------------------------------------------------ > ~~ Mes...

How do I make X-values of a chart dependent on values in cells?
Greetings. I have a chart which can go from x-value 0 to x-value 200. However I'd like to be able to input min X-value into a cell, and a max X-valu into a cell, and the x-value in the chart changes to reflect that. Is it possible to do that? Thanks for any replies. K -- Message posted from http://www.ExcelForum.com Hi, There is no automatic way to do this but take a look a Tushar's AutoChart Manager for a possible solution. (http://www.tushar-mehta.com/) Cheers Andy Kashgarinn < wrote: > Greetings. > > I have a chart which can go from x-value 0 to x-value 200...

modify linked cells without breaking link
I have a workbook with a number of worksheets (2003.) The 2nd and 3rd worksheets have cells that are linked to the 1st worksheet. This workbook will be used to schedule production. The 1st worksheet has a list of products that we produce. The 1st worksheet has a column for the min # of cases we need to keep in stock at all times and the max # of cases we must keep in stock at all times. The 1st worksheet also contains a column where the production scheduler would enter the actual # of cases in stock. The 2nd worksheet in the workbook takes the actual cs in stock and compares ...

Add data to cell w/o loosing initial data
I would like to know if there is a way to add data to data without retyping. For example I have a colum of 18015555555 and I want to add [rfax:(cell #)@/fn=(phone number)] So I would like to add the brackets - copy from a cell - @/fn= and not loose the data already in the spread sheet. Example 2. Add [rfax:company name@fn/=(saved data here) then close bracket. So I want to add data to cells without loosing the data already in the cells. I have about 600 of them to do and I really don't want to do each one by hand. Please let me know if anyone knows how to accomplish this. Tha...

format cell #4
In Access, I can set up a field that "forces" the user to enter info - a date, for example - in a certain way, such as 25 Jan 05 or enter time as 12:15 AM. Is there a way that I can "force" this in excel? Thank you. Hello- Without invoking something more technical, you can select the cell(s) and go to Data>Validation and choose what type of entry be allowed in the field. Format the cell in the manner you wish to have the date or time expressed. HTH |:>) "HJC" wrote: > In Access, I can set up a field that "forces" the user to enter in...

Formatting cells and getting pound signs
I am using Excel 2003 with all updates as of 4/28/04 and trying to format a cell using the custom category and choosing the #,##0.00 type. I am trying to add the $ symbol at the beginning of the type and add text at the end of the type to look like this $#,##0.00 "text". When I do this however it shows up in my cell on my worksheet as ##########. It does know what the value is and shows as I would expect it to when I place mouse over cell in a balloon If I use only the $ symbol befor the type it shows fine. If I use only the "text" after the type is shows fine. Using the...

Find and replace with bold in cells
I have a VB6 program that is executing Excel 2007, opening a worksheet, and extracting some of the cells to write data to a text file. Some of the cells contain bold text on some (not necessarily all) of the text in the cell. I would like to do a find and replace on the bold tagging to replace it with something like "<b>" at the start of it and "</b>" at the end of it. How do I set this up in VB6? Thanks! The following function will return a string including <b> and </b> tags from the text of cell R. Function BoldMarkup(R As Range) As...

Selecting cell value for a sum, based on a condition
Trying to come up with a formula or method that will enable me to sum values based on a condition. For example, I have three columns which contain a condition and two amounts. If the condition is of the 'each' variety, one value will be used in the sum. If the condition is of the "square foot" variety, another value will be used. Here is a small diagram that may help visualize this: A B C D 1 Measure Unit Cost S.F. Cost Summed Total 2 Each 3.00 .30 3 S.F....

Conditional Formatting on cells beginning with a hyphen
Is it possible to do conditional formatting on cells beginning with a hyphen? Thanks, Greg 1. Place the cursor in A1 cell and select the Range 2. From menu Format>Conditional Formatting> 3. For Condition1>Select 'Formula Is' and paste the below formula =LEFT(A1,1)="-" 4. Click Format Button>Font>Color select your desired font & Background Color pattern and then give ok Change the cell reference of A1 to your desired cell, if required. But keep in mind that when applying the conditional formatting the Active cell should be in the ce...

cell will not center
Hi. I have a user with an Excel worksheet. There are multiple rows and columns and they are all set on center alignment, (center alignment icon on the toolbar as well as Format Cells --> Horizontal Alignment --> Center.) The alphabetical characters align correctly but the numerical don't, as they will only left align. Format Cells --> Number is set to General, so I don't know why it won't change the alignment. Other than the worksheet being corrupted, I don't know what could be wrong with it. Any suggestions are much appreciated. Thanks! Hilary =?Utf-8?B?SG...

Count # of cells b/w cells ...
Hello, I have the following data in a column: 7 0 0 0 7 0 0 0 0 0 7 0 0 7 0 0 0 0 0 0 7 etc. The number of zero's between the 7's is random. I want a formula tha would count the number of zeros between the 7's. Thanks, Ari Bar -- AriBar ----------------------------------------------------------------------- AriBari's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2504 View this thread: http://www.excelforum.com/showthread.php?threadid=38806 Assume A5:A20 is the data, try this: B5 = A5+B4 (copy formula down) Now make a table with 2 column...

Too many different cell formats #6
I am running into the error message: Too many different cell formats Is there a solution to lowering the number of formats I am using? Just trying to change them to make some consistent gives me the same error message. I tried running the search on the forums on my topic but they have been disabled for a Microsoft upgrade. Thanks! One idea - Rob Bovey's excellent Utilities add-in will list all the formats in use in your workbook, allowing you to manually delete what isn't being used. http://www.appspro.com/Utilities/ExcelUtilities.htm You can also see the source code for ...

The Sum from 1 worksheet cell to another worksheet cell
the sum from one cell on sheet1 from another cell on sheet2,how do you do the formula qwerty: To sum the value on Sheet1, cell A10 with the cell value Sheet2, cell B20, enter =Sheet1!A10 + Sheet2!B20 (or you can enter '=' sign and click on A10, then enter the plus sign and click on B20) jeff >-----Original Message----- >the sum from one cell on sheet1 from another cell on sheet2,how do you do the formula >. > ...

what is the function and name is of the symbol in each table cell.
Under Paragraph I clicked the Show/Hide Symbol icon so I can now see a symbol at the end of each text within a table cell. I wondered what that is so I tried to use Help to find out. I did find help that mapped a word (like paragraph) into a symbol. But I can't find anywhere where if I know the symbol it will tell me the meaning. Can you tell me how to find such info? Or maybe you can tell me what the function and name is of the symbol in each table cell. Thanks I'm sorry, I meant to sent this to the Word group. Of course, I wouldn't mind getting the info...

Need Formula To Find Blank and NonBlank Cells
I have a worksheet with 6 columns (by Month) Sep Aug Jul Jun May Apr I have to review starting for example with May, I need to find any cell in May range that is null <> where Jun and Apr both are not null <> So if May is null and Jun and Apr are not null than I would count that as 1. If May is null and either Jun or Apr are null then I would not count them. =SUMPRODUCT(N(E2:E100=""),N(D2:D100<>""),N(F2:F100<>"")) "hilltop55" <hilltop55@discussions.microsoft.com> wrote in message news:08D989CB-D1B4-49F...

Need Syntax for "AND" to Evaluate 2 Cells
I need to evaluate 2 cells while inside an "Private Sub Worksheet_SelectionChange(ByVal Target As Range)". I thought AND would work but I cannot get it to work; I receive a syntax error on the AND(Range... line. Can someone please provide me the proper syntax to evaluate the 2 cells? Here's my code... Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveSheet.Name = "Sheet1" Then And(Range("I3") <> "", Range("K4") = "") Then Range("K4") = Range("K3") End...

Enter "1", cell show ".01". Why?
Any number typed into a cell is divided by 100. If proceded by "=" the number is correct. What caused this and how can I fix it? Try this .. Click Tools > Options > Edit tab Uncheck "Fixed decimal" > OK Things should be back to normal now .. (it's a fixed decimal setting !) -- Rgds Max xl 97 --- Singapore, GMT+8 xdemechanik http://savefile.com/projects/236895 -- "Yonian" <Yonian@discussions.microsoft.com> wrote in message news:40499CA4-7FAF-42A6-8B19-A90881735C50@microsoft.com... > Any number typed into a cell is divided by 100. > If p...

selecting a cell
I seem unable to select a single cell, or a single row--click on one in the normal manner, and the two below also highlight, then delete or whatever command is given. If I input a number/text, that just goes into the one cell. tapping F8 increases this to two wide and three high automatically selected. Also, very slow to do almost anything. Thanks Pat, Are you by any chance using Excel 2007? If so there is a known bug that causes multiple cell selection and I understand this has been reported to Microsoft. If you take the zoom level up and down this is reported to cl...

Assign a value to a cell
I'll apreciate your help with this in A1 i have a value in days that is used to make several calculations but I need it to change if a specific condition is given something lik this: A1=300 If b1<a1 then a1=b1 where b1 is a value calculated somewhere else. Thank you for your help. Rodolf -- Message posted from http://www.ExcelForum.com Hi try the following formula in A1: =MIN(B1,300) Frank > I'll apreciate your help with this > > in A1 i have a value in days that is used to make several > calculations, but I need it to change if a specific condition is > giv...

IF statement with FALSE value being text AND cell reference? #3
Once again, figured it out on my own. Oh, and thanks for the repl Frank. Needed to use the ROUND function: =IF(D9>1,D9*D8,"<" & ROUND((D9*D10),2) -- jcob ----------------------------------------------------------------------- jcob2's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1560 View this thread: http://www.excelforum.com/showthread.php?threadid=27157 ...

How do I add more columns past cell "IV"
You don't unless you buy the latest xl2007 due out soon -- Don Guillett SalesAid Software dguillett1@austin.rr.com "mr" <mr@discussions.microsoft.com> wrote in message news:7FA65FBA-33BD-4505-B503-B98FDB96FD63@microsoft.com... > Hello, Don! You wrote on Mon, 13 Nov 2006 18:06:33 -0600: DG> You don't unless you buy the latest xl2007 due out soon For my own curiosity, what sort of statistical data requires so many columns? This question is not meant sarcastically but I am just not familiar with very large data sets. James Silverton Potomac, Maryland ...

Update cell based on date range
Hey guys! I was wondering if I could get some help here. I would lik to update a cell based on a date range. For example, I would like t update the value of a cell to the value of another cell if the curren date is between July 1st and July 10th. However, if the date i outside the date range, I want the value for that cell to not b updated, and be the previous value. Can anyone give me an example a to how I would do this? Thanks!! -- deversol ----------------------------------------------------------------------- deversole's Profile: http://www.excelforum.com/member.php?action=geti...

Dynamic Image references in a cell
I am exporting a report from Access 2007 to Excel 2007 containing product information. I have an image for each product. Access does not export Images to Word or Excel. I have the URL or local path for the image standardized so the path is C;/temp/image[ID Num].jpg or http://www.temp.com/images/image[ID num].jpg. I have [ID num] in Column B for each row. I want to reference the image column A of each row. How do I get the image to display in the cell? -- Jim Fidler ...

Updating links
Hi, In one of our office spreadsheets, everytime it is opened it asks do you want to update cells from another spreadsheet. I believe when this spreadsheet was set up, a work sheet was copied from another spreadsheet. I thought that all the references to that other spreadsheet had been removed. Is there anyway to identify (other than manually checking each cell) which cell has a formula linked to the old spreadsheet. Thanks in advance, George Download and install Bill Manville's FindLink add-in, which you can find at: http://www.bmsltd.ie/MVP/ In article <bYd1d.27315$Z14.90...

How do I remove multiple hyperlinks in the same cell (Excel)?
I have multiple hyperlinks in one Excel cell, each separated by a hard return (ALT-Enter). I can remove the hyperlinks using: -- right click > remove hyperlink -- or by using a macro but I cannot get this to work on multiple links in one cell. When I do this, all links go into one line separated by a square box. I have had to create a separate line for the second hyperlink, and this is making my spreadsheet look out of alignment. Please help! ...