+ Reply to Thread
Results 1 to 7 of 7

Changing Cell References inside INDIRECT function.

  1. #1
    Registered User
    Join Date
    06-07-2016
    Location
    Fort Worth, Tx
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Changing Cell References inside INDIRECT function.

    Howdy. So I'm fairly inexperienced with Excel, but have gotten myself into a project where something I want to do seems to have turned out to be something of a chore. I have multiple sheets, and I want to have a single summary sheet that pulls data from one of the other sheets based upon the contents of a specified cell on the summary sheet. Thanks to Google and some posts on this very site, I've figure out how to do that:
    Please Login or Register  to view this content.
    where the second "A1" is just an example. Now here comes the problem that brought me here: I need to 1. be able to drag-autofill the formula across many cells such that the second A1 is changing to refer to new, specified cells on the other sheet, and 2. have the cell references increment by more than 1 when filling down the column (specifically I need it to increment by 4).

    This summary sheet it going to be pulling whether or not a radio has been signed out, and who has had that radio, during a particular day. It is the "who" part that involves the trouble, because each "who" is four rows down from the last. From my table:

    C3: Who:
    C4: Out:
    C5: In:
    C6: [BLANK ROW]
    C7: Who:
    C8: Out:
    C9: In:

    Therefore the cells (say) B2, B3, B4 need to pull from C3, C7, and C10.

    So, any clues on how to get the second A1 to increment, and how to get it to increment by 4?
    Last edited by Zox Tomana; 06-07-2016 at 08:29 PM.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Changing Cell References inside INDIRECT function.

    Try

    =INDIRECT($A$1&"!A"&(ROWS($A$1:$A1)-1)*4+3)

  3. #3
    Registered User
    Join Date
    06-07-2016
    Location
    Fort Worth, Tx
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Re: Changing Cell References inside INDIRECT function.

    That works perfectly going down the column once I get it switched out to the right row I want to pull from (changed the A's past the first to C's). Can it be modified to, at the same time, vary as you pull it across a row? Or does it need to have one (either row or column) be specified for the other to work? I can compromise and manually edit it for the start of each column.

    EDIT: Please pardon the mistake, I said "down the row" instead of "down the column". I've fixed it.
    Last edited by Zox Tomana; 06-07-2016 at 10:51 PM.

  4. #4
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Changing Cell References inside INDIRECT function.

    If you want it to change when you drag it up/down (row) but not left/right (column), change $A$1 to $A1
    If you want it to change when you drag it left/right (column) but not up/down (row), change $A$1 to A$1
    If you, well, want it to change however it is when you drag it, change to ... A1

    Or are you trying to change the A in "!A" part in the INDIRECT formula that Jonmo1 gave you? Can you clarify a bit more on what part you want to change when you "drag" the formula?
    (copy pasta from Ford)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools

    Regards,
    Lem

  5. #5
    Registered User
    Join Date
    06-07-2016
    Location
    Fort Worth, Tx
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Re: Changing Cell References inside INDIRECT function.

    I am trying to change the A in the "!A" portion, yes.

  6. #6
    Valued Forum Contributor Lemice's Avatar
    Join Date
    04-13-2013
    Location
    Somewhere.
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: Changing Cell References inside INDIRECT function.

    You can try changing "!A" to

    "!"&SUBSTITUTE(ADDRESS(1,COLUMN(),4),1,"")

    In Column A, the SUBSTITUTE(ADDRESS(1,COLUMN(),4),1,"") formula will return "A", if you want it to return "A" in Column C you will need to change it to

    SUBSTITUTE(ADDRESS(1,COLUMN()-2,4),1,"")

    Notice the "-2" there? I suggess messing around with it. If you want to see what it does, just put a "=" in front of it and it will be a normal formula, and you can paste it in any cell to see what it does / what you can change to make it do what you want.

  7. #7
    Registered User
    Join Date
    06-07-2016
    Location
    Fort Worth, Tx
    MS-Off Ver
    Office 365 ProPlus
    Posts
    4

    Re: Changing Cell References inside INDIRECT function.

    That pretty solidly solves it, Lemice, thanks =)

    My final formula: posted in cell A1, taking the sheet name from G1, and drawing data a table whose useful info starts in column F is this:

    Please Login or Register  to view this content.
    And a quick test of dragging it around and seeing if it grabs the right data from some test inputs makes it seem like it works... so... Thank y'all so very much for all y'all's help!

+ 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] INDIRECT Function NOT capturing all of the references
    By Murphy15 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 02-09-2017, 10:00 PM
  2. Using Structured Table References and Indirect Function
    By tjeasy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-02-2016, 07:07 PM
  3. Using Indirect function inside the Search function
    By skhari in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2014, 05:32 PM
  4. INDIRECT function not working inside MATCH with dynamic ranges
    By fotografer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-26-2014, 02:09 AM
  5. INDIRECT inside a LINEST function
    By Glenn Kennedy in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 12-24-2013, 12:06 PM
  6. [SOLVED] Changing cell references in INDIRECT function
    By GavJ in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-25-2013, 11:38 PM
  7. [SOLVED] Using ROW function inside of both an Indirect and Index function returns #VALUE
    By xandermacleod in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-11-2012, 06:22 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