+ Reply to Thread
Results 1 to 12 of 12

Indirect or Absolute Formula auto-fill to update reference, possible?

  1. #1
    Registered User
    Join Date
    08-20-2007
    Posts
    10

    Indirect or Absolute Formula auto-fill to update reference, possible?

    Hello,

    I'm using Excel 2003 for payroll deductions. I have one workbook with two worksheets. One worksheet (information sheet) is were I enter all of the information. The other (payroll sheet) calculates the information from the first. I want to use an indirect formula so if a co-worker goes into the information sheet and cuts and pastes something, it won't change the formula on the payroll deduction sheet. Is there a way to auto-fill down the indirect formula so I won't have to type it in thousands of times?

    To clarify, this is the formula
    =INDIRECT("'Monthly Deductions-Elections '!$M$11")*12/26

    If I copy and paste, or auto-fill with the mouse, to a different cell the exact same formula is pasted there.

    I want to be able to paste it and have the references change automatically. Example
    =INDIRECT("'Monthly Deductions-Elections '!$M$11")*12/26
    =INDIRECT("'Monthly Deductions-Elections '!$M$12")*12/26
    =INDIRECT("'Monthly Deductions-Elections '!$M$13")*12/26

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2006
    Location
    Melbourne, Australia
    MS-Off Ver
    Office 2016
    Posts
    1,075
    Quote Originally Posted by brandoncartwrig
    I want to be able to paste it and have the references change automatically. Example
    =INDIRECT("'Monthly Deductions-Elections '!$M$11")*12/26
    =INDIRECT("'Monthly Deductions-Elections '!$M$12")*12/26
    =INDIRECT("'Monthly Deductions-Elections '!$M$13")*12/26
    Delete the $ sign in front of the row number, like this:
    =INDIRECT("'Monthly Deductions-Elections '!$M12")*12/26

    $ makes the reference absolute, so deleting it makes the reference relative so it can change.
    Trish in Oz
    -------------
    A problem well defined is a puzzle half solved


    If you attach a sample of your workbook it will be easier to find a solution. Remember to remove/replace sensitive data before uploading the file. Look here if you need help with attachments:
    http://www.excelforum.com/faq.php?fa...b3_attachments

  3. #3
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by brandoncartwrig
    Hello,

    I'm using Excel 2003 for payroll deductions. I have one workbook with two worksheets. One worksheet (information sheet) is were I enter all of the information. The other (payroll sheet) calculates the information from the first. I want to use an indirect formula so if a co-worker goes into the information sheet and cuts and pastes something, it won't change the formula on the payroll deduction sheet. Is there a way to auto-fill down the indirect formula so I won't have to type it in thousands of times?

    To clarify, this is the formula
    =INDIRECT("'Monthly Deductions-Elections '!$M$11")*12/26

    If I copy and paste, or auto-fill with the mouse, to a different cell the exact same formula is pasted there.

    I want to be able to paste it and have the references change automatically. Example
    =INDIRECT("'Monthly Deductions-Elections '!$M$11")*12/26
    =INDIRECT("'Monthly Deductions-Elections '!$M$12")*12/26
    =INDIRECT("'Monthly Deductions-Elections '!$M$13")*12/26
    Hi,

    the formula shown

    =INDIRECT("'Monthly Deductions-Elections '!$M$11")*12/26

    appears to have no use for the Indirect function.

    You can utilise the function as something like

    =INDIRECT("'Monthly Deductions-Elections '!$M$"&Row()+10)*12/26

    where the row number for the formula is an offset of the current row()

    Let me know how you go.
    ---
    Si fractum non sit, noli id reficere.

  4. #4
    Registered User
    Join Date
    08-20-2007
    Posts
    10
    Quote Originally Posted by tuph
    Delete the $ sign in front of the row number, like this:
    =INDIRECT("'Monthly Deductions-Elections '!$M12")*12/26

    $ makes the reference absolute, so deleting it makes the reference relative so it can change.

    Thanks for replying.

    I need to keep the references absolute so that if a row is added above or below the reference it won't change the formula.

    Also, I've noticed if I try to auto-fill down the INDIRECT formula without the absolute reference it won't change the reference, which is what I'm after in this case.

  5. #5
    Registered User
    Join Date
    08-20-2007
    Posts
    10
    Quote Originally Posted by Bryan Hessey
    Hi,

    the formula shown

    =INDIRECT("'Monthly Deductions-Elections '!$M$11")*12/26

    appears to have no use for the Indirect function.

    You can utilise the function as something like

    =INDIRECT("'Monthly Deductions-Elections '!$M$"&Row()+10)*12/26

    where the row number for the formula is an offset of the current row()

    Let me know how you go.
    ---

    Thank You for your reply, Brian. I appreciate any suggestions.

    The reason I need to use the INDIRECT funtion for this formula is so it won't change if someone Cut and Pastes or drag and pastes the reference cell.

    Sorry Brian, I was not able to get the formula you gave me to work right.

    I did find a solution to my problem, but a new problem has surfaced. I'll tell ya'll how I fixed it, and what that new problem is tomorrow. My office is closing and I've got to head home now.

    Thanks

  6. #6
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by brandoncartwrig
    Thanks for replying.

    I need to keep the references absolute so that if a row is added above or below the reference it won't change the formula.

    Also, I've noticed if I try to auto-fill down the INDIRECT formula without the absolute reference it won't change the reference, which is what I'm after in this case.

    ---


    The reason I need to use the INDIRECT funtion for this formula is so it won't change if someone Cut and Pastes or drag and pastes the reference cell.

    >> I was not able to get the formula you gave me to work right.

    I did find a solution to my problem, but a new problem has surfaced. I'll tell you how I fixed it, and what that new problem is tomorrow. My office is closing and I've got to head home now.
    To define 'absolute', if you change the colour of A1 to red, and then insert a row brfore 1, the red cell is now A2.

    Did you want to refer to the red cell, or did you want to refer to the cell that is the top left cell of the spreadsheet (A1)?

    Perhaps you want to add the balance from the previous row, which fails when you add or delete intervening rows in a column, for that, in B2, you can use

    =OFFSET(A2,-1,0)

    ie, in B2 =A2+OFFSET(B2,-1,0)

    hth
    ---

  7. #7
    Registered User
    Join Date
    08-20-2007
    Posts
    10
    Quote Originally Posted by Bryan Hessey
    To define 'absolute', if you change the colour of A1 to red, and then insert a row brfore 1, the red cell is now A2.

    Did you want to refer to the red cell, or did you want to refer to the cell that is the top left cell of the spreadsheet (A1)?

    Perhaps you want to add the balance from the previous row, which fails when you add or delete intervening rows in a column, for that, in B2, you can use

    =OFFSET(A2,-1,0)

    ie, in B2 =A2+OFFSET(B2,-1,0)

    hth
    ---

    In the case of =OFFSET(A2,-1,0), say that formula is in B2. If 100 is in A1, 100 will show up in B2. If I cut and paste or drag and paste 100 to a different cell the formula changes to =OFFSET(#REF!,-1,0), and if I move the 100 back to A1 it doesn't correct the formula. I have to have the formula stay the same even if the reference cell has been moved, which is why I need the INDIRECT formula with an absolute reference.

  8. #8
    Registered User
    Join Date
    08-20-2007
    Posts
    10
    Okay here is the solution I came up with to what I was trying to do.

    First of all, the formula on the first page has to be an INDIRECT formula with an abosolute reference ($A$1) to the second page. The reason it has to be an abosulte reference is, incase a row is added or deleted above or below the reference. If a row is added or deleted, it will change the reference in the formula if it is not absolute. The reason the formula has to also be an INDIRECT formula is becasue even though the reference is absolute it will change if the reference cell is cut and pasted or drag and pasted to a new location. The problem is when I create an INDIRECT formula with an absolute reference, I can't auto-fill the formula to multiple cells and have the absolute reference update to the corosponding reference.

    So here is what I did.

    I created another worksheet like this. Please refer to the PDF attachment INDIRECT FORMULA.

    I typed the different parts of the formula into seperate cells.

    Typing the absolute reference as text in D1 allowed me to auto-fill down giving me $M$1, $M$2, $M$3, and so on.

    I typed in a combining formula, which you can see in cell F1, to combine all of the cells and create the complete formula I need for my other workbook as a result. Then I selected cells A1, B1, C1, D1, E1, and F1 and auto-filled down 1000 rows. Finaly, I selected and copied column F and then paste specialed the values only in column G.

    That left me with one problem. Even though column G contains the new formula, Excel reads it as text unless I double-click on each individual G cell and press enter. Then Excel reads it as the formula it's supposed to. I've got thousands of these formulas. Does anyone know of a way to make Excel read all them as a formula with just a few clicks of a button? Its not just the show/hide formula function. I've tried that.

    Thanks
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    03-13-2005
    Posts
    6,195
    Quote Originally Posted by brandoncartwrig
    Okay here is the solution I came up with to what I was trying to do.

    First of all, the formula on the first page has to be an INDIRECT formula with an abosolute reference ($A$1) to the second page. The reason it has to be an abosulte reference is, incase a row is added or deleted above or below the reference. If a row is added or deleted, it will change the reference in the formula if it is not absolute. The reason the formula has to also be an INDIRECT formula is becasue even though the reference is absolute it will change if the reference cell is cut and pasted or drag and pasted to a new location. The problem is when I create an INDIRECT formula with an absolute reference, I can't auto-fill the formula to multiple cells and have the absolute reference update to the corosponding reference.

    So here is what I did.

    I created another worksheet like this. Please refer to the PDF attachment INDIRECT FORMULA.

    I typed the different parts of the formula into seperate cells.

    Typing the absolute reference as text in D1 allowed me to auto-fill down giving me $M$1, $M$2, $M$3, and so on.

    I typed in a combining formula, which you can see in cell F1, to combine all of the cells and create the complete formula I need for my other workbook as a result. Then I selected cells A1, B1, C1, D1, E1, and F1 and auto-filled down 1000 rows. Finaly, I selected and copied column F and then paste specialed the values only in column G.

    That left me with one problem. Even though column G contains the new formula, Excel reads it as text unless I double-click on each individual G cell and press enter. Then Excel reads it as the formula it's supposed to. I've got thousands of these formulas. Does anyone know of a way to make Excel read all them as a formula with just a few clicks of a button? Its not just the show/hide formula function. I've tried that.

    Thanks
    I guess my difficiency in the area of comprehension is starting to show, but I have little (if any) idea of what you said, nor why you did what you did.

    You cannot make-up an instruction the way you appear to have made it and expect that it will operate the way you were hoping.

    Your .pdf is nice, but of little use in a forum, a sample .xls would have given a chance to see what you wee trying to do, however very few helpers want to expend time transposing details from your typing or displays to make an accurate test book.

    I have no idea why you would add a space to the end of a Worksheet name as you appear to be indicating in the C of your .pdf.

    You refer to "an abosolute reference ($A$1) to the second page" but you then display an A1 which contains just an = sign

    You say "Please refer to the PDF attachment INDIRECT FORMULA.". I presume that you meant the .pdf of a similar name and that you had not posted the wrong .pdf

    The closest guess to an answer for what you are trying to do is still,

    in A1 put

    Monthly Deductions-Elections

    with no leading nor trailing spaces, and name the sheet accordingly.

    in B1 put

    =INDIRECT("'"&A$1&"'!M"&ROW())

    and formula fill that downwards.

    Does this do what you wanted?
    ---

  10. #10
    Registered User
    Join Date
    08-31-2009
    Location
    boarders' paradise
    MS-Off Ver
    Excel 2002
    Posts
    94

    Re: Indirect or Absolute Formula auto-fill to update reference, possible?

    Quote Originally Posted by brandoncartwrig View Post
    I'm using Excel 2003 for payroll deductions. I have one workbook with two worksheets. One worksheet (information sheet) is were I enter all of the information. The other (payroll sheet) calculates the information from the first. I want to use an indirect formula so if a co-worker goes into the information sheet and cuts and pastes something, it won't change the formula on the payroll deduction sheet.
    Out of sheer desperation: I have the same problem as you, Mr. Cartwrig. If you found a feasible working solution, could you please post it here in this thread so that other users (incl. myself) can benefit from it? Many thanks in advance.
    Last edited by boarders paradise; 07-19-2011 at 02:23 PM.

  11. #11
    Registered User
    Join Date
    08-18-2011
    Location
    Phoenix, United States
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: Indirect or Absolute Formula auto-fill to update reference, possible?

    I have the same issue. I am attempting to compare columns of text, with a formula:

    =IF((INDIRECT("A2")=INDIRECT("B2")), 1, 0)

    INDIRECT must be used so that when rows in one column are deleted, excel will still compare the two cells that are adjacent to one another.

    When I attempt to copy this formula down the rest of the spreadsheet (by pulling the lower right hand corner of the cell with the + sign), I would like A2 to become A3, then A4, then A5, etc. and B2 to become B3 then B4, then B5, etc. Unfortunately, it just copies as A2, A2, A2, all the way down the spreadsheet (and B2, B2, B2).

    While removing INDIRECT allows me to copy the formula and have A2 become A3, then A4, etc., the cell references change when the rows in one column are deleted.

    Any help you can give would be much, much appreciated.

  12. #12
    Registered User
    Join Date
    04-22-2012
    Location
    Norway
    MS-Off Ver
    Excel 2010
    Posts
    1

    Re: Indirect or Absolute Formula auto-fill to update reference, possible?

    Hi,

    I came here with the same problem, got started, and found out I could use the row() function for this purpose:

    =IF((INDIRECT("A"&ROW())=INDIRECT("B"&ROW())), 1, 0)

    Hope this may help you

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1