+ Reply to Thread
Results 1 to 9 of 9

Indirect address?

Hybrid View

M1234 Indirect address? 03-03-2014, 02:26 PM
XOR LX Re: Indirect address? 03-03-2014, 02:30 PM
M1234 Re: Indirect address? 03-04-2014, 05:31 AM
M1234 Re: Indirect address? 03-04-2014, 05:36 AM
Pete_UK Re: Indirect address? 03-04-2014, 05:47 AM
M1234 Re: Indirect address? 03-04-2014, 07:31 AM
Pete_UK Re: Indirect address? 03-04-2014, 07:40 AM
XOR LX Re: Indirect address? 03-04-2014, 05:52 AM
martindwilson Re: Indirect address? 03-04-2014, 06:22 AM
  1. #1
    Registered User
    Join Date
    07-18-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    88

    Exclamation Indirect address?

    Hi all,

    I'm trying to do a sum formula based on certain criteria. I want the formula to say =SUM('Sheet 1'!H83:'Sheet 1'!J83) but I want the J83 part to be based on the week number so that it automatically extends the range to the right when a week is added. e.g. when it's week 7 it should say =SUM('Sheet 1'!H83:'Sheet 1'!M83).

    I have a cell that says "Week 1-5" and I'm doing a RIGHT formula and looking that up to give me a column reference as per below:

    1 G
    2 H
    3 I
    4 J
    5 K
    6 L
    7 M
    8 N
    9 O
    10 P
    11 Q
    12 R

    I can get it to say =SUM('Sheet 1'!H83:'Sheet 1'!J83) but it keeps on coming up with either a #VALUE or #REF error.

    Any help would be much appreciated.

  2. #2
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Indirect address?

    Hi,

    Try inserting an INDIRECT formula around the address string you create before passing to the SUM.

    Regards
    Click * below if this answer helped

    Advanced Excel Techniques: http://excelxor.com/

  3. #3
    Registered User
    Join Date
    07-18-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Indirect address?

    Quote Originally Posted by XOR LX View Post
    Hi,

    Try inserting an INDIRECT formula around the address string you create before passing to the SUM.

    Regards
    It still comes up with the REF error.

    I have even tried putting 'Sheet 1'!G83 in one cell and 'Sheet 1'!K83 in another cell and then put =SUM(INDIRECT(((K17)&":"&(K18)))) but it has the same error.

    When I evaluate it, it looks as though there are 3 ''' at the start instead of 2.

  4. #4
    Registered User
    Join Date
    07-18-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Indirect address?

    I've created a mock excel file to show you how I've been unsuccesfully doing it
    Attached Files Attached Files

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

    Re: Indirect address?

    The only numbers you have on Sheet1 are on row 4, so I don't know why you are trying to add those from row 83. I think this is what you are trying to achieve in I6:

    =SUM(INDIRECT("'Sheet 1'!H4:"&(VLOOKUP(RIGHT(D3,1),$C$8:$D$19,2,0)&"4")))

    although using RIGHT(D3,1) means you will only be able to get up to week 9.

    Hope this helps.

    Pete

  6. #6
    Registered User
    Join Date
    07-18-2013
    Location
    London
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Indirect address?

    Quote Originally Posted by Pete_UK View Post
    The only numbers you have on Sheet1 are on row 4, so I don't know why you are trying to add those from row 83. I think this is what you are trying to achieve in I6:

    =SUM(INDIRECT("'Sheet 1'!H4:"&(VLOOKUP(RIGHT(D3,1),$C$8:$D$19,2,0)&"4")))

    although using RIGHT(D3,1) means you will only be able to get up to week 9.

    Hope this helps.

    Pete

    Hi Pete,

    My main sheet was row 83 but I created a mock up to remove the sensitive data but placed it in row 4 instead. Thanks for the help, this works perfectly.

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

    Re: Indirect address?

    Okay, glad to be able to help.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

  8. #8
    Forum Expert XOR LX's Avatar
    Join Date
    04-18-2013
    Location
    Turin, Italy
    MS-Off Ver
    Office 365
    Posts
    7,742

    Re: Indirect address?

    Repeating the Sheet 1 ref is problematic when passed to INDIRECT. Try:

    =SUM(INDIRECT("'"&"Sheet 1'!H83:"&(VLOOKUP(RIGHT(D3,1),$C$8:$D$19,2,0)&"4")))

    Regards

  9. #9
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Indirect address?

    id go for
    =SUM(INDIRECT("'"&"Sheet 1'!H4:"&(VLOOKUP(SUBSTITUTE(RIGHT(D3,2),"-",""),$C$8:$D$19,2,0)&"4")))
    but im pretty sure this can be done with just an index what is the real layout?
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

+ 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. Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Andy Wiggins in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 06:05 AM
  2. Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  3. [SOLVED] Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 12:05 AM
  4. [SOLVED] Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  5. Allow EXCEL INDIRECT(ADDRESS()) and INDIRECT(RANGE()) functions
    By Mike Barlow in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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