+ Reply to Thread
Results 1 to 6 of 6

Copying down an indirect formula

Hybrid View

  1. #1
    Registered User
    Join Date
    04-19-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    21

    Copying down an indirect formula

    How can I copy down an indirect formula? When I copy it the lookup reference doesn't change.

    My formula is:
    =IF(INDIRECT("Q1")="",INDIRECT("R1"),INDIRECT("Q1"))

    but when I copy down the cell reference stays the same (I need to keep the indirect formula because I'm adding columns in column Q but it needs to reference column Q even when columns are added). From reading through some other posts I believe I need to add a ROW() or COLUMN() formula in there somewhere.

    Anyone run into this before? Any ideas?
    Last edited by sable; 08-20-2009 at 10:12 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Copying down an indirect formula

    If you're putting this formula IN row1 somewhere, then this is an equivalent formula that will adjust the numeric portion upward as you copy down.

    =IF(INDIRECT("Q" & ROW())="",INDIRECT("R" & ROW()),INDIRECT("Q" & ROW()))

    If that formula isn't going IN row1, but you need the first cell it is in to equal "1" in the numeric, then:

    =IF(INDIRECT("Q" & ROW(A1))="",INDIRECT("R" & ROW(A1)),INDIRECT("Q" & ROW(A1)))
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Copying down an indirect formula

    Can we first enquire as to why you're using INDIRECT ?

    Is it because you're inserting / removing rows and/or columns ?

    I would probably advocate use of INDEX first off...

  4. #4
    Registered User
    Join Date
    04-19-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Copying down an indirect formula

    Whew! Thanks so much JBeaucaire

    This:
    =IF(INDIRECT("Q" & ROW())="",INDIRECT("R" & ROW()),INDIRECT("Q" & ROW()))
    worked for me...

    DonkeyOte, as I said in my original post it's because I'm adding columns that I needed to use indirect. I'm not sure how INDEX works though so that may have been another option. Thanks for your reply!

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Copying down an indirect formula

    If you're adding colums

    =IF(INDEX($1:$65536,ROWS(A$1:A1),17)="",INDEX($1:$65536,ROWS(A$1:A1),18),INDEX($1:$65536,ROWS(A$1:A1),17))
    above would return contents of Q1, when copied down Q2 etc etc...

    The reason I mentioned INDEX is that INDIRECT is Volatile and brings it with potentially unnecessary calculation overheads. Unless you're deleting entire sheets the INDEX approach is normally viable (& preferable IMO).

  6. #6
    Registered User
    Join Date
    04-19-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    21

    Re: Copying down an indirect formula

    Thank you! That also works in this case so I'll take your advice and use it since you say that indirect comes with problems.

+ 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