+ Reply to Thread
Results 1 to 9 of 9

Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

  1. #1
    Registered User
    Join Date
    11-11-2011
    Location
    Wyoming
    MS-Off Ver
    Excel 2003
    Posts
    4

    Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    I am working in Excel 2003. I am working only within a single workbook.

    I am using sumproduct across multiple worksheets (25) to a single summary worksheet.

    The formula I am using is as follows:

    =SUMPRODUCT(('1:25'!A3:A85=A2)*('1:25'!E3:E85=YES))

    Worksheets are simply numbered 1 through 25.

    However, when I hit Enter the following formula replaces mine seemingly indicating another workbook called "25" as designated by the addition of the brackets [ ]?

    =SUMPRODUCT(('1:[25]25'!A3:A85=A2)*('1:[25]25'!E3:E85=YES))

    Why is it doing this and how do I get it to just sum across worksheets 1-25 within the workbook?
    Last edited by wyowok; 11-14-2011 at 07:47 PM.

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

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    you cant use sumproduct in a 3d way like that
    "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

  3. #3
    Registered User
    Join Date
    11-11-2011
    Location
    Wyoming
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    Quote Originally Posted by martindwilson View Post
    you cant use sumproduct in a 3d way like that
    What is a better way to achieve this without using sumproduct? Thanks.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    In every sheet you can enter the formula:

    PHP Code: 
    =SUMPRODUCT((A3:A85='1'!A2)*(E3:E85="yes")) 
    If you do that e.g. in every sheet in cell H5

    you can use the formula
    PHP Code: 
    =SUM('1:25'!H5
    to get the total.



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

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    forgot that approach.as an addition you don't need to enter the formula 25 times
    select all sheets(group) and enter the formula =SUMPRODUCT((A3:A85='1'!A2)*(E3:E85="yes")) in say b1,it will be repeated across all the sheets, then un group

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    Quote Originally Posted by wyowok View Post
    The formula I am using is as follows:

    =SUMPRODUCT(('1:25'!A3:A85=A2)*('1:25'!E3:E85=YES))
    What's in A2? Assuming that's a text value then try using this "array formula" in the summary sheet

    =SUM(IF(T(INDIRECT("'"&ROW(INDIRECT("1:25"))&"'!A"&TRANSPOSE(ROW(INDIRECT("3:85")))))=A2,T(INDIRECT("'"& ROW(INDIRECT("1:25"))&"'!E"&TRANSPOSE(ROW(INDIRECT("3:85")))))="Yes")+0)

    confirmed with CTRL+SHIFT+ENTER

    If A2 is numeric then change the red T to N
    Last edited by daddylonglegs; 11-12-2011 at 12:01 PM.
    Audere est facere

  7. #7
    Registered User
    Join Date
    11-11-2011
    Location
    Wyoming
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    I cut and pasted this formula and entered as an array: Control+Shift+Enter:

    =SUM(IF(T(INDIRECT("'"&ROW(INDIRECT("1:25"))&"'!A"&TRANSPOSE(ROW(INDIRECT("3:85")))))=A2,T(INDIRECT("'"& ROW(INDIRECT("1:25"))&"'!E"&TRANSPOSE(ROW(INDIRECT("3:85")))))="Yes")+0)

    I am getting an #REF error message?

    I attached a Print Screen shot of my spreadsheet. Column A does contain text (peoples names).
    Attached Files Attached Files

  8. #8
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    #REF! probably indicates a problem with the sheet names, do you definitely have 1 to 25 (I can only see up to 21 in the screenshot)?

    The names must be exactly those numbers. If one of the sheet names has a space or other characater within it then the formula won't work

    Test by adding a blank sheet and put 1 to 25 in A1:A25 then in B1 this formula copied down

    =INDIRECT("'"&A1&"'!A1")

    That should give you the A1 value from each sheet. If any one or more gives you a #REF! error then the sheet name isn't exactly that number.....

  9. #9
    Registered User
    Join Date
    11-11-2011
    Location
    Wyoming
    MS-Off Ver
    Excel 2003
    Posts
    4

    Re: Excel 2003 Adding Unwanted Brackets [ ] to Sumproduct Formula

    Quote Originally Posted by daddylonglegs View Post
    #REF! probably indicates a problem with the sheet names, do you definitely have 1 to 25 (I can only see up to 21 in the screenshot)?

    The names must be exactly those numbers. If one of the sheet names has a space or other characater within it then the formula won't work

    Test by adding a blank sheet and put 1 to 25 in A1:A25 then in B1 this formula copied down

    =INDIRECT("'"&A1&"'!A1")

    That should give you the A1 value from each sheet. If any one or more gives you a #REF! error then the sheet name isn't exactly that number.....
    It worked!! I found that worksheets 2 and 3 had a space after the number I couldn't see. Once I deleted the space it worked like a charm.

    Thanks so much for your help!!

+ 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