Consulting

Results 1 to 5 of 5

Thread: Solved: SUMIF Formula

  1. #1

    Question Solved: SUMIF Formula

    good day!

    I had this problem of getting the total of for a sales..
    I want to sum all the values on a single column with a condition,
    and that condition is refer to another column or value of a cell in a column..

    examples..
    sum if <Range of Cells> equal to "cash"
    sum if <Range of Cells> equal to "check"
    sum if <Range of Cells> equal to "card"

    sum if <Range of Cells> not equal to "cash"
    sum if <Range of Cells> not equal to "check"
    sum if <Range of Cells> not equal to "card"

    attached is my example file..


    thanks

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Grand Master mdmackillop's Avatar
    Joined
    May 2004
    Location
    Scotland
    Posts
    14,489
    Location
    Hi Robert
    You could use SumProduct
    =SUMPRODUCT(--(A$2:A$8="cash"),(B$2:B$8)) see http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    or SUMIF
    =SUMIF(A$2:A$8,"card",B$2:B$8)
    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'

  3. #3
    VBAX Expert Shazam's Avatar
    Joined
    Sep 2005
    Posts
    530
    Location
    See if this helps.


    Select A10

    Go to:
    Insert > Define > Name

    Name: Array

    type this into the:

    Refers to:

    =EVALUATE("{"""&SUBSTITUTE(Sheet1!$A10," ",""",""")&"""}")

    Click Ok

    Then input formula in cell B10 and copied down.


    =SUMPRODUCT(SUMIF($A$2:$A$8,Array,$B$2:$B$8))


    Hope it works for you.
    Last edited by Shazam; 09-19-2006 at 07:08 PM.
    SHAZAM!

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Be aware that versions of Excel prior to 2002/XP will crash and burn if copying and pasting cells between worksheets where the cells contain references to defined names that refer to XLM functions.

  5. #5

    Thank you

    Quote Originally Posted by mdmackillop
    Hi Robert
    You could use SumProduct
    =SUMPRODUCT(--(A$2:A$8="cash"),(B$2:B$8)) see http://www.xldynamic.com/source/xld.SUMPRODUCT.html
    or SUMIF
    =SUMIF(A$2:A$8,"card",B$2:B$8)
    Thank you guys i really appretiate it.. you help a lot....
    Now im exploring the formula for more use....

    thanks

Posting Permissions

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