+ Reply to Thread
Results 1 to 5 of 5

Indirect() between multiple sheets?

  1. #1
    Registered User
    Join Date
    11-29-2007
    Posts
    10

    Indirect() between multiple sheets?

    I am trying to create a 3d sumif via sumproducts/indirect. I have figured out how to do so, but I have run into another problem. See below for my function.

    =IF(K1="","",SUMPRODUCT(SUMIF(INDIRECT("'" & {"X", "Y", "Z"} & "'!A:A"),A1,INDIRECT("'" & {"X", "Y", "Z"} & "'!K:K"))))

    where: X, Y, Z are the sheets names.

    I have more than those three sheet names and will likely add more to the workbook. My question is: Is it possible to do an indirect across multiple sheets without listing them out one by one. I've tried adding a page at the beginning and at the end and adding "start:end" to the function. However, this does not seem to work. If anyone has a solution I would appreciate it.

    Thanks,
    Chris

  2. #2
    Forum Contributor Lotus123's Avatar
    Join Date
    11-07-2005
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    153
    Is there an option to name your sheets as follows:

    Sheet1
    Sheet2
    Sheet3
    Sheet4 (name doesn't matter, but having the digit at the end does).

    Then use this formula:

    Please Login or Register  to view this content.
    I couldn't get SUMPRODUCT or SUMIF to work with 3D sheets...I suspect it is a limitation. SUM works fine. Thus, another alternative, is you could put a SUMIF in cell N1 of of each sheet (X,Y,Z), and then just use a formula like this:

    Please Login or Register  to view this content.
    Ecce Potestas Casei
    Nathan Head

  3. #3
    Registered User
    Join Date
    11-29-2007
    Posts
    10
    My sheets are actually organized as dates, so renaming them isn't an option.

    A little background on what I'm trying to do.

    My workbook essentially a time sheet for me to keep track of all my projects and the hours I work each day. Essentially, it is organized as such:

    A=Project

    B=Mon
    C=Tues
    D=Wed
    E=Thurs
    F=Fri
    G=Sat
    H=Sun

    I=Weekly Total
    J=Total to DATE

    J is the column for which I am developing the formula. I want it to sum all time worked on project A1 and output in J1. The reason I cannot sumif on the page and then just 3d sum is because the I am adding new projects all the time. Also, projects are not always on the same line week to week.

  4. #4
    Forum Contributor Lotus123's Avatar
    Join Date
    11-07-2005
    Location
    Texas
    MS-Off Ver
    2007
    Posts
    153
    Download and install the add-in available here:

    http://xcell05.free.fr/morefunc/english/index.htm

    Then use this formula instead:

    =IF(K1="","",SUMPRODUCT((THREED(X:Z!A1:A1000)=A1)*THREED(X:Z!K1:K1000)))

    THREED is a formula that tweaks Excel into allowing SUMPRODUCT to work in 3D.

    It provides the same answer as your original formula in my tests.

  5. #5
    Forum Contributor
    Join Date
    09-25-2004
    Posts
    269
    Quote Originally Posted by ctasich
    My question is: Is it possible to do an indirect across multiple sheets without listing them out one by one. I've tried adding a page at the beginning and at the end and adding "start:end" to the function. However, this does not seem to work. If anyone has a solution I would appreciate it.

    Thanks,
    Chris

    Yes it is possible But don't have the formula in the same column where trying to reference from or you will get a circular reference error.

    Select C2

    Insert > Name > Define

    Name: Shts

    Refers to:

    =MID(GET.WORKBOOK(1),FIND("]",GET.WORKBOOK(1))+1,255)

    Click Ok

    Then try...

    =SUMPRODUCT(SUMIF(INDIRECT("'"&Shts&"'!A2:A10"),A2,INDIRECT("'"&Shts&"'!B2:B10")))

    Hope this helps!
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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