Consulting

Results 1 to 10 of 10

Thread: Solved: Sumproduct - Summing

  1. #1
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location

    Solved: Sumproduct - Summing

    Hi

    trying to put a SUMPRODUCT formula in my workbook and I am now tying myself in knots.

    Column A Column B Column C
    Feb Ness 7
    Feb Don 3
    Feb Tay 1
    Feb Clyde 2
    Feb Ness 1

    I want to be able to add Column C for all that have the properties Feb, Ness, Don + Tay

    SUMPRODUCT(($A6:$A$5404=G7),($C$6:$C$5404="Ness")+($C$6:$C$5404="Don")+($C$ 6:$C$5404="Tay")),$E$6:$E$5404))

    I finally got to this but it's wrong.

    Any help appreciated
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Try

    =SUMPRODUCT(($A6:$A$5404=G7)*($C$6:$C$5404={"Ness","Don","Tay"})*($E$6:$E$5 404))

    watch out for the injected spaces.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Perfect!!!

    Once again you have lived up to your title of Distinguished Lord of VBAX

    Thanks Bob

    Gerry
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  4. #4
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Hi Bob

    hope I didn't jump the gun earlier. When I try this it seems to adding the Don & Tay figures but missing the Ness figures??

    Am I missing something?
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  5. #5
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Gerry,
    Can you post your test data?
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  6. #6
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Sure, please find copy attached.

    Going forward I would probably like to add another condition into the formula that only counts if it is a Non Std Connection or and so on.

    All these results will have to go into a pivot table and chart....but I am getting ahead of myself
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  7. #7
    Administrator
    VP-Knowledge Base VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Try replacing "Ness " with "Ness". There's a monster of a gap in there!
    MVP (Excel 2008-2010)

    Post a workbook with sample data and layout if you want a quicker solution.


    To help indent your macros try Smart Indent

    Please remember to mark threads 'Solved'

  8. #8
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location


    Don't believe that!!!!!

    Thanks for pointing that out to me - works perfectly - thread still solved!

    Thanks again
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

  9. #9
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Gerry,

    Use

    =SUMPRODUCT(($A$4:$A$5404=H7)*(TRIM($B$4:$B$5404={"Ness","Don","Clyde"}))*( $D$4:$D$5404))

    and then just append another condition

    =SUMPRODUCT(($A$4:$A$5404=H7)*(TRIM($B$4:$B$5404)={"Ness","Don","Clyde"})*( $C$4:$C$5404="Non Std Connection")*($D$4:$D$5404))
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  10. #10
    VBAX Mentor Hoopsah's Avatar
    Joined
    Nov 2007
    Posts
    303
    Location
    Thanks Bob - I have put the amendment in and tried putting some spaces back in to test and it works great

    Cheers again for all your help
    I am playing all the right notes, but not necessarily in the right order.
    Eric Morecambe

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •