+ Reply to Thread
Results 1 to 10 of 10

SUMIF Formula for Months !!!

  1. #1
    Registered User
    Join Date
    04-04-2011
    Location
    VA
    MS-Off Ver
    Excel 2016
    Posts
    43

    SUMIF Formula for Months !!!

    Hello,

    Please help, I need to do a quick SUmIF formula

    IF the Range B5:B9 falls under June, then add that particular Line item on Column C


    so the formula for C12 should be $200

    please see attachment.

    thanks,
    Attached Files Attached Files

  2. #2
    Forum Contributor BenMiller's Avatar
    Join Date
    12-06-2011
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    254

    Re: SUMIF Formula for Months !!!

    Can't open your attachment and I don't know if you need SUMIF, but what about
    =SUMPRODUCT(--(MONTH(B5:B9)=6),--(C5:C9))

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMIF Formula for Months !!!

    Try:

    =SUMIF($B$5:$B$9,">="&EOMONTH(B12,-1)+1,$C$5:$C$9)-SUMIF($B$5:$B$9,">"&EOMONTH(B12,0),$C$5:$C$9)

    if you get #NAME error, go to Tools|Addins and check Analysis Toolpak Addin
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  4. #4
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: SUMIF Formula for Months !!!

    Use..in C12

    =SUMPRODUCT(--(MONTH($B$5:$B$9)=MONTH(B12)),--($C$5:$C$9)) and drag down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMIF Formula for Months !!!

    note:... for larger lists, SUMIF is more efficient than Sumproduct....

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: SUMIF Formula for Months !!!

    or an pivot table.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  7. #7
    Forum Expert ben_hensel's Avatar
    Join Date
    01-26-2012
    Location
    Northeast USA
    MS-Off Ver
    Office 365
    Posts
    2,043

    Re: SUMIF Formula for Months !!!

    Let's take advantage of two things:

    1) Excel counts dates forward from a reference (1 = Jan 1, 1900 in the 1900 date system).

    2) You're indexing with dates in the B12:B18 array for the output table.

    So:
    Please Login or Register  to view this content.
    Pull down to c17.

    Because b19 = 0 (when assessed by the SUMIFS), you'll get 0 for December no matter what, though, so that column alone requires a different formula; just chop off the last two arguments so that
    Please Login or Register  to view this content.

  8. #8
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: SUMIF Formula for Months !!!

    Note - The SUMIFS function will not work in 2003 version

  9. #9
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: SUMIF Formula for Months !!!

    Note also, my original formula was given assuming you are using Excel 2003, as per your user info, but your file is .xlsx.. so you can use simplified:

    =SUMIFS($C$5:$C$9,$B$5:$B$9,">="&EOMONTH(B12,-1)+1,$B$5:$B$9,"<="&EOMONTH(B12,0))

  10. #10
    Registered User
    Join Date
    04-04-2011
    Location
    VA
    MS-Off Ver
    Excel 2016
    Posts
    43

    Re: SUMIF Formula for Months !!!

    thanks so much!! rep.

+ 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