+ Reply to Thread
Results 1 to 6 of 6

Relative reference with Indirect function

  1. #1
    Registered User
    Join Date
    06-20-2013
    Location
    LondOn, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Relative reference with Indirect function

    Hi Experts,

    I am trying to sum over multiple sheets dependent on multiple criteria. I reproduce below the formula in one of the cells. The formula is working fine except i need the it to be relative. i.e. when i drag the formula across and down I want the "k26" to change accordingly.

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Sheetlist&"'!B2"),B12,INDIRECT("'"&Sheetlist&"'!k26")))

    I have tried the following but am getting ref errors. What am i doing wrong?

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Sheetlist&"'!B2"),B10,INDIRECT("'"&Sheetlist&CELL("address",K26))))


    'sheetlist' refers to a named list and B2 and B12 being criteria.

    Sbz

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: Relative reference with Indirect function

    Try this

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Sheetlist&"'!B2"),B10,INDIRECT(Sheetlist&"!"&CELL("address",K26))))
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,704

    Re: Relative reference with Indirect function

    How far across do you want to copy (i.e. how many columns?). If it is less than 26 then you could use a CHAR function to generate the equivalent of the K, dependent on the column the formula is in, and the 26 could be generated by ROWS($1:26) which will increment when it is copied down. Do you want the B12 (shown as B10 in the lower example) to also change when the formula is copied?

    Pete

  4. #4
    Registered User
    Join Date
    06-20-2013
    Location
    LondOn, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Relative reference with Indirect function

    That works a treat. Really appreciate the prompt response. Thank you.

  5. #5
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,812

    Re: Relative reference with Indirect function

    I have mentioned in other threads that one way to get relative references in INDIRECT() is to use R1C1 notation (optional second argument of INDIRECT() function: https://support.office.com/en-us/art...1-92b6306fa261 ). You don't indicate what cell this formula is in. If I assume it is also in K26 and you only want the K26 reference to be relative, then the formula would become =SUMPRODUCT(SUMIF(INDIRECT("'"&Sheetlist&"'!B2"),B12,INDIRECT("'"&Sheetlist&"'!RC",FALSE))). If you are unfamiliar with using R1C1 notation, this page describes how to use different reference styles: https://support.office.com/en-us/art...es_in_formulas
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  6. #6
    Registered User
    Join Date
    06-20-2013
    Location
    LondOn, England
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Relative reference with Indirect function

    Thanks for the response, appreciate you looking at the problem. - Special-K's correction above to my formula seems to have fixed it.

+ 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] Embedding a relative cell address in an INDIRECT function with VBA
    By aquixano in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 03-13-2018, 12:38 AM
  2. Indirect Sheet reference with cell reference left function and text
    By teststrip in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-01-2015, 10:31 AM
  3. How to use relative reference with a Function?
    By GSM in forum Excel General
    Replies: 0
    Last Post: 07-21-2011, 11:19 AM
  4. Relative/Indirect reference to file names
    By Hambone70 in forum Excel General
    Replies: 7
    Last Post: 03-07-2011, 12:42 PM
  5. Relative reference with Rank function
    By shikamikamoomoo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 11-05-2007, 04:14 PM
  6. Relative addressing with INDIRECT function
    By john in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-08-2006, 09:20 AM
  7. [SOLVED] Trying to use the INDIRECT funtion with a relative Row reference
    By Paul Cahoon in forum Excel General
    Replies: 1
    Last Post: 12-29-2005, 04:10 AM

Tags for this Thread

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