+ Reply to Thread
Results 1 to 6 of 6

Using indirect to sum multiple worksheet cells

  1. #1
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    Using indirect to sum multiple worksheet cells

    Hi,
    This works:
    =SUM(INDIRECT("'Sheet2'!$C$1:$C$5"),INDIRECT("'Sheet3'!$C$1:$C$5"))

    These do not:
    =SUM(INDIRECT({"'Sheet2'!$C$1:$C$5";"'Sheet3'!$C$1:$C$5"}))
    =SUM(INDIRECT("'"&Sheets&"'!$C$1:$C$5"))
    Where Sheets refers to =Sheet1!$A$1:$A$2
    [A1=]Sheet1, [A2=]Sheet2

    For the last two ONLY Sheet2 is summed, not sheet3

    Any suggestions?
    Attached Files Attached Files
    Last edited by rwgrietveld; 10-09-2008 at 04:39 AM.
    Looking for great solutions but hate waiting?
    Seach this Forum through Google

    www.Google.com
    (e.g. +multiple +IF site:excelforum.com/excel-general/ )

    www.Google.com
    (e.g. +fill +combobox site:excelforum.com/excel-programming/ )

    Ave,
    Ricardo

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Why not try =sum(sheet1:sheet3!c1:c5) ?

  3. #3
    Valued Forum Contributor
    Join Date
    08-26-2008
    Location
    singapore
    Posts
    626
    Yes, you are right, the last 2 can not work
    Because the ref_txt is neither a cell nor a range
    I need your support to add reputations if my solution works.


  4. #4
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Using indirect to sum multiple worksheet cells

    Thank you for the reply. I may have oversimplified my question. I want to be flexible and therefore I would like to use dynamic names in the future.

    I found something similar in the forum:
    =SUMPRODUCT((COUNTIF(INDIRECT("'"&sheets&"'!$C$1:$C$15"),D$2&$A7)))
    Where sheets again is a range of cells containing Sheetnames.

    How can I use names in my indirect?

  5. #5
    Valued Forum Contributor Richard Schollar's Avatar
    Join Date
    05-23-2006
    Location
    Hampshire UK
    MS-Off Ver
    Excel 2002
    Posts
    1,264
    I could get it to work using SUMPRODUCT/SUMIF:

    =SUMPRODUCT(SUMIF(INDIRECT({"Sheet1!A1:A5","Sheet2!A1:A5"}),"<>"))

    Richard
    Richard Schollar
    Microsoft MVP - Excel

  6. #6
    Valued Forum Contributor rwgrietveld's Avatar
    Join Date
    09-02-2008
    Location
    Netherlands
    MS-Off Ver
    XL 2007 / XL 2010
    Posts
    1,671

    re: Using indirect to sum multiple worksheet cells

    Dear Richard,

    I rebuilt it a bit and ... it works.
    =SUMPRODUCT(SUMIF(INDIRECT("'"&Sheets&"'!$C$1:$C$15"),"<>"))

    Gr,
    Ricardo

+ 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. Joining multiple cells into one line.
    By DaithiW in forum Excel General
    Replies: 3
    Last Post: 03-26-2008, 03:34 PM
  2. unwanted pause while picking multiple cells
    By ukiflyer in forum Excel General
    Replies: 0
    Last Post: 02-20-2008, 02:57 PM
  3. Resetting multiple cells (to zero)
    By Caleo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-31-2007, 06:03 AM
  4. Populating a worksheet from multiple IF statements
    By kaitewright in forum Excel General
    Replies: 1
    Last Post: 03-02-2007, 08:58 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