+ Reply to Thread
Results 1 to 4 of 4

Help with Array Formula

  1. #1
    Registered User
    Join Date
    10-30-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    2

    Help with Array Formula

    I have a list of expenses. Column A has the date of the expense and column D has the amount. I want to create a table that sums the expense by month. In column CE I have a date, for example 12/1/2014. I created an array formula which gives me all expenses for the month - =SUM((MONTH($A$7:$A$2000)=MONTH(CE10))*$D$7:$D$2000). However, December will be listed for 2014 and also for 2015. So I want to modify the formula to also account for the year. I tried this, but it didn't work - =SUM(AND((MONTH($A$7:$A$2000)=MONTH(CE10)),YEAR($A$7:$A$2000)=YEAR(CE10))*$D$7:$D$2000) Can anyone help with this? Thanks.

  2. #2
    Forum Expert azumi's Avatar
    Join Date
    12-10-2012
    Location
    YK, Indonesia
    MS-Off Ver
    Excel 2019
    Posts
    2,368

    Re: Help with Array Formula

    perhaps :

    =SUM((YEAR($A$7:$A$2000)=YEAR(CE10)*(MONTH($A$7:$A$2000)=MONTH(CE10))*$D$7:$D$2000))

    and array entered

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Help with Array Formula

    Try this array* formula:

    =SUM((TEXT($A$7:$A$2000,"yymm")=TEXT(CE10,"yymm"))*($D$7:$D$2000))

    *Don't forget to use Ctrl-Shift-Enter to commit the formula.

    Or you could try this normally-entered formula:

    =SUMPRODUCT((TEXT($A$7:$A$2000,"yymm")=TEXT(CE10,"yymm"))*($D$7:$D$2000))

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    10-30-2015
    Location
    New Jersey
    MS-Off Ver
    2010
    Posts
    2

    Re: Help with Array Formula

    Thanks Azumi - that worked !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question about using Evaluate with an array of formulas not an array formula
    By Mr_Bill in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-19-2014, 03:26 PM
  2. Can I make the row lookup array/range part in an array formula variable?
    By OLLY-7 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-18-2014, 09:06 AM
  3. [SOLVED] Evaluate Named Range Array formula to VBA Array
    By cmore in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-07-2014, 09:06 PM
  4. Array formula + Array formula with criteria that lookups a Table
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-16-2013, 11:41 AM
  5. Replace hard coded array in formula with link to input array
    By David Brown in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-08-2011, 07:45 AM
  6. Converting 3x10 array to a 1X30 array to run a Match formula
    By NBVC in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-08-2009, 07:45 AM
  7. [SOLVED] Tricky array formula issue - Using array formula on one cell, then autofilling down a range
    By aspenbordr in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-27-2005, 11:05 AM

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