+ Reply to Thread
Results 1 to 7 of 7

drag-across of INDIRECT function does not change cell reference between " " marks

  1. #1
    Registered User
    Join Date
    03-07-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    drag-across of INDIRECT function does not change cell reference between " " marks

    Hi all,

    I'm having an issue with dragging cell formulas across and having them update the column reference.

    I have multiple formula referencing a single cell (cell A2) to get a numeric value to incorporate into a cell reference - so I can update this single cell and have all the formula calculate over increasing ranges as I add data to my spreadsheet each month. I have used the INDIRECT function over several formula in the same column, but when I drag across to the right, the column letter reference does not update because it is in " " marks.

    I did find a similar solution on the forum, but am confused since my " " marks contain two column/letter references.

    The formula I am trying to drag across are like this:

    =ConsecUpDays(INDIRECT("D25:D" &$A$2))
    =MaxPosSequence(INDIRECT("D25:D" &$A$2))

    =AVERAGE(IF((INDIRECT("D25:D" &$A$2))>0,((INDIRECT("D25:D" &$A$2))),""))

    =COUNTIF((INDIRECT("D25:D" &$A$2)),"<>0")

    Any help would be much appreciated!

  2. #2
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: drag-across of INDIRECT function does not change cell reference between " " marks

    Try this to get an understanding of what you need to do

    Put any values in cells E2,F2,G2

    enter this in B3 and drag it to the right
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    When placed in B3
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    evaluates to D2
    So the dragged formula becomes
    =D2
    =E2
    =F2...etc

    So (usually) when dragging across use the Column() function and when dragging down use the Row() function
    Last edited by kev_; 03-07-2018 at 06:13 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,215

    Re: drag-across of INDIRECT function does not change cell reference between " " marks

    Example ..

    use AVERAGEIF function ...

    =AVERAGEIF(INDIRECT(ADDRESS(25,COLUMN(D:D))&":"&ADDRESS($A$2,COLUMN(D:D))),">0",INDIRECT(ADDRESS(25,COLUMN(D:D))&":"&ADDRESS($A$2,COLUMN(D:D))))

  4. #4
    Registered User
    Join Date
    03-07-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    Re: drag-across of INDIRECT function does not change cell reference between " " marks

    Thanks kev_,

    I did experiment with that formula, but could not get it to work with my formula and have Excel accept it. I'm wanting to change the "D25:D" values to "E25:D", "G25:G" as I drag the formula across.

    Not sure how to get inside the " " marks to have it increment by column letter as I drag.

  5. #5
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: drag-across of INDIRECT function does not change cell reference between " " marks

    Here is another example - this time using OFFSET

    If A2 = 50
    Put this in a cell in Column D and the OFFSET is Zero columns
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    so theformula becomes
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Dragged across it becomes E, F, G etc as the column OFFSET increases

    NOTE:
    the offset to use is the correct one relative to the column of the first result cell
    If you want the result starting in column A dragged right then the above formula's offset is changed:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    etc

    YOUR FORMULA
    If your formula is entered in column D and dragged right - this should work
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by kev_; 03-07-2018 at 06:49 AM.

  6. #6
    Registered User
    Join Date
    03-07-2018
    Location
    London
    MS-Off Ver
    2010
    Posts
    3

    Re: drag-across of INDIRECT function does not change cell reference between " " marks

    Very big Thank You _kev and John Topley.

    I see what you meant now _kev. Thanks John, I was able to use that to amend my formula and make them draggable.

    My formula now read:

    =ConsecUpDays(INDIRECT(ADDRESS(25,COLUMN(D:D))&":"&ADDRESS($A$2,COLUMN(D:D))))
    =MaxPosSequence(INDIRECT(ADDRESS(25,COLUMN(D:D))&":"&ADDRESS($A$2,COLUMN(D:D))))

    =AVERAGEIF(INDIRECT(ADDRESS(25,COLUMN(D:D))&":"&ADDRESS($A$2,COLUMN(D:D))),">0",INDIRECT(ADDRESS(25,COLUMN(D:D))&":"&ADDRESS($A$2,COLUMN(D:D))))

    =COUNTIF((INDIRECT(ADDRESS(25,COLUMN(D:D))&":"&ADDRESS($A$2,COLUMN(D:D)))),"<>0")

    Much appreciated.

  7. #7
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: drag-across of INDIRECT function does not change cell reference between " " marks

    You are welcome
    Thanks for the reps
    To mark thread as SOLVED - click ThreadTools@TopOfThread
    Last edited by kev_; 03-07-2018 at 07:23 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Use "INDIRECT" Function to reference sheet
    By PJenkins in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-01-2017, 10:10 PM
  2. [SOLVED] drag-down of indirect function does not change cell reference within " "
    By alsan in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-15-2016, 07:09 AM
  3. How to update cell reference when "dragging" and INDIRECT forumla
    By mikicia in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-10-2014, 04:48 PM
  4. Circular Reference? - INDIRECT and CELL("filename") Usage
    By Nicked in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-19-2012, 01:20 PM
  5. [SOLVED] drag-down of indirect function does not change cell refereence between speech marks
    By nils7 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 10-07-2012, 04:51 AM
  6. Replies: 4
    Last Post: 10-29-2009, 12:08 PM
  7. "Indirect" reference to a cell in a code: how to do it?
    By bondcrash in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-16-2005, 12:05 PM

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