+ Reply to Thread
Results 1 to 12 of 12

Need Help With Cross Sheet Array Argument

  1. #1
    Registered User
    Join Date
    07-31-2012
    Location
    Buffalo, United States
    MS-Off Ver
    MS Office 2007, 2010, 2013
    Posts
    59

    Need Help With Cross Sheet Array Argument

    I try to setup something like this:

    Please Login or Register  to view this content.
    However I get #REF error. Any idea to fix this?
    Last edited by jackgan; 05-09-2014 at 03:54 PM.

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need Help With Cross Sheet Array Argument

    Not real clear.

    Are you testing that EVERY cell is <1000 or ANY cell is <1000?
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    07-31-2012
    Location
    Buffalo, United States
    MS-Off Ver
    MS Office 2007, 2010, 2013
    Posts
    59

    Re: Need Help With Cross Sheet Array Argument

    Quote Originally Posted by Tony Valko View Post
    Not real clear.

    Are you testing that EVERY cell is <1000 or ANY cell is <1000?
    I think I will change it to this for better understanding:

    Please Login or Register  to view this content.
    And also can you show me a way to test if EVERY and ANY cell is <1000?

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need Help With Cross Sheet Array Argument

    OK, you want to do a SUMIF across the sheets. It's a bit more complicated.

    Are the sheet names really Sheet1, Sheet2, Sheet3, etc. ? If so, then we can build the sheet names directly into the formula. If the real sheet names are randomly named then you'll need to enter the sheet names in a range of cells and refer to that range.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need Help With Cross Sheet Array Argument

    P.S.

    I'm getting ready to break for lunch so I'll be offline for a few hours.

  6. #6
    Registered User
    Join Date
    07-31-2012
    Location
    Buffalo, United States
    MS-Off Ver
    MS Office 2007, 2010, 2013
    Posts
    59

    Re: Need Help With Cross Sheet Array Argument

    Quote Originally Posted by Tony Valko View Post
    OK, you want to do a SUMIF across the sheets. It's a bit more complicated.

    Are the sheet names really Sheet1, Sheet2, Sheet3, etc. ? If so, then we can build the sheet names directly into the formula. If the real sheet names are randomly named then you'll need to enter the sheet names in a range of cells and refer to that range.
    Yah it probably will be SUMIF. The sheet names that I am going to use will be like Contact 1 all the way to Contact 20. I tested with the following and it works while changing the name from standard Contact 1 to Contact 20 into any sheet name according to the name.

    Please Login or Register  to view this content.

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need Help With Cross Sheet Array Argument

    This formula will do a SUMIF A1<1000 across the sheets Contact 1 thru Contact 20.

    =SUMPRODUCT(SUMIF(INDIRECT("'Contact "&ROW(INDIRECT("1:20"))&"'!A1"),"<1000"))

    Note that all the sheets must already exist otherwise you'll get an error.

  8. #8
    Registered User
    Join Date
    07-31-2012
    Location
    Buffalo, United States
    MS-Off Ver
    MS Office 2007, 2010, 2013
    Posts
    59

    Re: Need Help With Cross Sheet Array Argument

    That will not work if I change the sheet name, however I do have a Summary sheet with range A1:A20 with the name I want to rename the sheet which will be done using macro, will that help?

    My current situation is referring to this post. What I tried to do is to put A B C into separate sheet but still have the array working. I don't know if that can be done but if not then I probably just need to do it manually (end up with a long formula).

    http://www.excelforum.com/excel-form...the-money.html

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need Help With Cross Sheet Array Argument

    If the sheet names are in the range A1:A20, try this:

    =SUMPRODUCT(SUMIF(INDIRECT("'"&A1:A20&"'!A1"),"<1000"))

  10. #10
    Registered User
    Join Date
    07-31-2012
    Location
    Buffalo, United States
    MS-Off Ver
    MS Office 2007, 2010, 2013
    Posts
    59

    Re: Need Help With Cross Sheet Array Argument

    It works if the sheet name is Contact1 to Contact20 (No Space). Is there a way to make it work with space in it?

    Also can you explain why you need to put ' in that way? I know this might sounds stupid but I really curious, or it is just the way it is?

    =SUMPRODUCT(SUMIF(INDIRECT(" ' "&A1:A20&" ' !A1"),"<1000"))

  11. #11
    Registered User
    Join Date
    07-31-2012
    Location
    Buffalo, United States
    MS-Off Ver
    MS Office 2007, 2010, 2013
    Posts
    59

    Re: Need Help With Cross Sheet Array Argument

    Quote Originally Posted by jackgan View Post
    It works if the sheet name is Contact1 to Contact20 (No Space). Is there a way to make it work with space in it?

    Also can you explain why you need to put ' in that way? I know this might sounds stupid but I really curious, or it is just the way it is?

    =SUMPRODUCT(SUMIF(INDIRECT(" ' "&A1:A20&" ' !A1"),"<1000"))
    I think I had figure it out. The formula I use is as below. Thanks Tony Valko for the help!

    Please Login or Register  to view this content.

  12. #12
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Need Help With Cross Sheet Array Argument

    Good deal. Thanks for the feedback!

+ 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. Replies: 0
    Last Post: 11-07-2013, 03:52 PM
  2. SEARCH function returns array if first argument is array--Huh?
    By 6StringJazzer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-10-2012, 07:23 PM
  3. [SOLVED] ByRef argument type mismatch / Passing array as a function argument
    By pzling in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-29-2012, 06:23 PM
  4. Passing an array as an argument
    By johncassell in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-13-2009, 10:32 AM
  5. [SOLVED] Function (array argument, range argument, string argument) vba
    By Witek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-24-2005, 11:07 AM

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