+ Reply to Thread
Results 1 to 8 of 8

array formula to return sum of values based on date and category code

  1. #1
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    10

    array formula to return sum of values based on date and category code

    Hi all, bit new to array formulas and having some trouble working through this issue.

    On the template tab in cell C5 I am trying to create an array formula that captures the category and corresponding dates from the "12 month sales" tab and sum them for each respective date.

    Thanks for the help!

    Excel Array Problem.xlsx

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: array formula to return sum of values based on date and category code

    I tested for a few of the items on TEPLATE against 12 MONTH, and couldnt find any matches?

    I dont think you need an array formula, just use sumifS()
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: array formula to return sum of values based on date and category code

    I'm having trouble writing it with a sumif formula. I'm trying to populate the table by matching the category codes and dates on the table with the corresponding "sales dollars" column on the 12 month sales tab.

    I'm using this array formula in C5

    =SUM(('12 Month Sales'!salescategory=Template!$B5)*('12 Month Sales'!datefile=Template!C$3)*('12 Month Sales'!$J$3:$J$3476))

    It is not returning the summed total for each month/category for the sales dollars column.

    Any help would be appreciated
    Last edited by usmc0331; 05-17-2013 at 09:11 PM.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: array formula to return sum of values based on date and category code

    I think you missed that I suggested sumifS(), not sumif()?

  5. #5
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: array formula to return sum of values based on date and category code

    I'm having trouble with the formula, I have:

    =SUMIFS('12 Month Sales'!$H$3:$H$3476,'12 Month Sales'!salescategory,Template!$B5,'12 Month Sales'!datefile,Template!C$3)

    (Salescategory being the named range of all the sales categories and datefile being the same for the dates)

    can you offer any advice on the formula?

    Thank you

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: array formula to return sum of values based on date and category code

    What trouble are you having?

    When I enter your formula in Template C5, I get 1568. Copied down and across, it seems to work fine?
    1568...538...17.......
    0..........10....0..........

  7. #7
    Registered User
    Join Date
    05-16-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: array formula to return sum of values based on date and category code

    when I enter the formula in I'm getting " - " as a result in each cell when I drag copy it down and across.

    It will return the values for some of the cells, but will only return one value for each row.

    for example, there are multiple categories that have sales on Apr-04, but the formula only returns a value for the "manholes carbon" category with a value of 5 in cell C18. The rest of the column is filled with "-" as a value.
    Last edited by usmc0331; 05-18-2013 at 07:56 AM.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: array formula to return sum of values based on date and category code

    I dont know what you are doing wrong, but once again, I copied your formula into C5, and copied it down and across - and got values in all rows and columns - except for where teh category doesnt exist.

    See the attached
    Attached Files Attached Files

+ 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