+ Reply to Thread
Results 1 to 10 of 10

Formula doesn't work when indirectly referencing a range of cells from concatenate formula

  1. #1
    Registered User
    Join Date
    10-30-2014
    Location
    MO
    MS-Off Ver
    2010
    Posts
    6

    Formula doesn't work when indirectly referencing a range of cells from concatenate formula

    I have a cell (say H6) containing concatenated information to result in a range (for example, "A1:C11"). If I wanted to sum up this range and typed it manually as =sum(A1:C11) it works, but if I wanted to refer to the same information but in a concatenated form that's in cell H6, I cannot. The formula I use is =sum(indirect("H6")).

    I tried copying cell H6 and pasting the value into cell I6, and copying that value from the formula bar back into the summation cell, it works.

    How can I reference the contents of cell H6 so that when it's plugged into the sum formula it'll work?
    Attached Files Attached Files

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

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    You don't need quotes around the H6, so do it like this:

    =SUM(INDIRECT(H6))

    Hope this helps.

    Pete

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    Or, combined...
    =SUM(INDIRECT(G3&H3&":"&G4&H4))
    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
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-30-2014
    Location
    MO
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    Quote Originally Posted by Pete_UK View Post
    You don't need quotes around the H6, so do it like this:

    =SUM(INDIRECT(H6))

    Hope this helps.

    Pete
    Wow! Thank you so much! Is there a reason why I do need the quotations when I type in =indirect function in a cell but don't need them in this case?

  5. #5
    Registered User
    Join Date
    10-30-2014
    Location
    MO
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    Quote Originally Posted by FDibbins View Post
    Or, combined...
    =SUM(INDIRECT(G3&H3&":"&G4&H4))
    Thank you, this worked also! And I can skip having another cell displaying the concatenate value, too! Thank you so much!

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

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    INDIRECT expects a text parameter which represents a range. In your case, you already had that in H6, so you can refer to H6 directly in the formula, but you could do it like this:

    =SUM(INDIRECT("A1:C11"))

    where that range has to be within quotes, or you can do it like Ford has suggested and miss out the intermediate cell value.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    10-30-2014
    Location
    MO
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    Quote Originally Posted by FDibbins View Post
    Or, combined...
    =SUM(INDIRECT(G3&H3&":"&G4&H4))
    What if G3:H4 were on sheet 2 and the data it's referring to be summed is still on sheet 1? What would this formula look like then?

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

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    You would have to have the sheet reference in front of each cell reference, like this:

    =SUM(INDIRECT(Sheet2!G3&Sheet2!H3&":"&Sheet2!G4&Sheet2!H4))

    Suppose, though, that the range you want to sum is actually on Sheet3, with those cells on Sheet2 containing the references - then you would have this:

    =SUM(INDIRECT("'Sheet3'!"&Sheet2!G3&Sheet2!H3&":"&Sheet2!G4&Sheet2!H4))

    Here the Sheet3 reference has to be within quotes (and it's always safer to put the apostrophes in), as that forms part of the final range reference that you want INDIRECT to act upon.

    Hope this helps.

    Pete

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,051

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    What exactly are you trying to sum? Perhaps a regulat formula will do what you want instead?

  10. #10
    Registered User
    Join Date
    10-30-2014
    Location
    MO
    MS-Off Ver
    2010
    Posts
    6

    Re: Formula doesn't work when indirectly referencing a range of cells from concatenate for

    Quote Originally Posted by Pete_UK View Post
    You would have to have the sheet reference in front of each cell reference, like this:

    =SUM(INDIRECT(Sheet2!G3&Sheet2!H3&":"&Sheet2!G4&Sheet2!H4))

    Suppose, though, that the range you want to sum is actually on Sheet3, with those cells on Sheet2 containing the references - then you would have this:

    =SUM(INDIRECT("'Sheet3'!"&Sheet2!G3&Sheet2!H3&":"&Sheet2!G4&Sheet2!H4))

    Here the Sheet3 reference has to be within quotes (and it's always safer to put the apostrophes in), as that forms part of the final range reference that you want INDIRECT to act upon.

    Hope this helps.

    Pete
    This worked perfectly, thank you so much for helping me out!

+ 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. Indirectly referencing the name of a named range
    By dustinseely in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2012, 08:54 PM
  2. [SOLVED] Indirectly referencing a worksheet within a formula
    By hackwill in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-26-2012, 07:22 PM
  3. express range in formula..indirectly
    By xlepws in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-15-2012, 09:53 AM
  4. Formula doesn't work in some cells
    By mateoc15 in forum Excel General
    Replies: 2
    Last Post: 04-27-2010, 01:04 PM
  5. Replies: 14
    Last Post: 09-05-2005, 11:05 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