+ Reply to Thread
Results 1 to 6 of 6

Use of an array formula to sum dollar amounts based on date

Hybrid View

  1. #1
    Registered User
    Join Date
    03-07-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007/2010, Outlook 2007/2010
    Posts
    60

    Use of an array formula to sum dollar amounts based on date

    Dear all:

    The attached file includes the problem. I have a list of dollar amounts in column A and a list of dates in column B. In cell E4 I have an array formula which runs through the entire date list and sums all the dollar amounts corresponding to those dates which occur in the month of August (month #8). I need to expand the formula to so that it only adds those dollar amounts which occur in the month of August 2013. The first formula works great, the second is returning a sum of 0.

    First formula (working):
    {=SUM(IF(MONTH(B4:B17)=8,(A4:A17),0))}
    Second formula (not working):
    {=SUM(IF(AND(MONTH(B4:B17)=8,YEAR(B4:B17)=2013),(A4:A17),0))}
    Month Year Array Sum.xlsx

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Use of an array formula to sum dollar amounts based on date

    Here's one way to do it:

    =SUMPRODUCT(--(TEXT(B4:B17,"mmmyyyy")=TEXT(D4,"mmmyyyy")),A4:A17)

    BTW, the date in cell D4 = 1/8/2013. There are no dates in column B for the month of January.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    03-07-2013
    Location
    Phoenix, AZ
    MS-Off Ver
    Excel 2007/2010, Outlook 2007/2010
    Posts
    60

    Re: Use of an array formula to sum dollar amounts based on date

    Works perfectly. Thank you!

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Use of an array formula to sum dollar amounts based on date

    You're welcome. Thanks for the feedback!

  5. #5
    Forum Expert ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2010
    Posts
    2,952

    Re: Use of an array formula to sum dollar amounts based on date

    Try this:

    =SUM(IF(YEAR(IF(MONTH(B4:B17)=8,B4:B17))=2013,A4:A17))
    Confirm as an array formula with Ctrl-Shift-Enter
    Would you like to say thanks? Please click the: " Add Reputation" button, on the grey bar below the post.

  6. #6
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Use of an array formula to sum dollar amounts based on date

    Ctrl + Shift + Enter

    =SUM(IF(MONTH(B4:B17)=8,IF(YEAR(B4:B17)=2013,(A4:A17),0)))

+ 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