+ Reply to Thread
Results 1 to 7 of 7

Thread: Using SUMIF

  1. #1
    Registered User
    Join Date
    08-26-2008
    Location
    alberta
    MS-Off Ver
    2003
    Posts
    17

    Using SUMIF

    I am trying to sum the values of entries corresponding to a particular month in a summary table. I have tried using the following formula:

    =SUM(IF(MONTH('Daily KPIs'!$B$1:$B$249)=MONTH('Monthly KPIs vs Plan'!O2),$B$1:$B$249,0))

    Does anyone know a better way of doing it? Thank you for your time.
    Last edited by msbaath; 10-26-2009 at 12:41 PM.

  2. #2
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,441

    Re: Using SUMIF

    A SUMPRODUCT formula will likely work, but it will be easier to provide and exact answer f you upload a sample workbook and manually show the results you want.

    Please complete your profile to, at least, show which version of Excel you are using. Version 2007 has a new feature called SUMIFS that could prove useful.
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Registered User
    Join Date
    08-26-2008
    Location
    alberta
    MS-Off Ver
    2003
    Posts
    17

    Re: Using SUMIF

    This worked:

    Thank you for responding!
    Attached Files Attached Files

  4. #4
    Forum Guru Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007
    Posts
    3,441

    Re: Using SUMIF

    I'm not a fan of array formulas since they can be a resource hog, especially if used much.

    Here is an alternative formula using SUMPRODUCT.
    =SUMPRODUCT((MONTH(Data!$A$3:$A$42)=MONTH(C$1))*(Data!$B$3:$B$42))
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  5. #5
    Forum Moderator DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Suffolk, UK
    MS-Off Ver
    2002, 2007 & 2010
    Posts
    21,379

    Re: Using SUMIF

    SUMPRODUCT is not really any more efficient than an Array - it's just slightly more robust in so far as does not require CSE -- it's processed in similar vein.

    msbaath, although less elegant it's nearly always better in these scenarios (in efficiency terms) to either

    a) combine 2 SUMIF functions

    b) use helper @ source

    Example of

    a)
    'Monthly Summary'!C2:
    =SUMIF(Data!$A:$A,">="&C$1,INDEX(Data!$B:$D,0,ROWS(B$2:B2)))-SUMIF(Data!$A:$A,">="&DATE(YEAR(C$1),MONTH(C$1)+1,1),INDEX(Data!$B:$D,0,ROWS(B$2:B2)))
    copied across matrix

    Example of
    b)
    Data!E3: =A3-DAY(A3)+1
    copied down

    this normalises the dates such that all appear as 1st of month meaning 1 SUMIF required

    'Monthly Summary'!C2
    =SUMIF(Data!$E:$E,C$1,INDEX(Data!$B:$D,0,ROWS(B$2:B2)))
    copied across matrix

  6. #6
    Registered User
    Join Date
    08-26-2008
    Location
    alberta
    MS-Off Ver
    2003
    Posts
    17

    Re: Using SUMIF

    Thank you guys!

  7. #7
    Registered User
    Join Date
    08-26-2008
    Location
    alberta
    MS-Off Ver
    2003
    Posts
    17

    Re: Using SUMIF

    I love both option A & option B.. thank you donkeyOte. Thanks to you, I just learned about INDEX fuction!

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.2.0