+ Reply to Thread
Results 1 to 6 of 6

Advice needed - SUMIFS/SUMPRODUCT Issues

  1. #1
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Tampa, Florida
    MS-Off Ver
    Excel 2013
    Posts
    142

    Advice needed - SUMIFS/SUMPRODUCT Issues

    Hello all,

    I am trying to sum the values in a row based on certain conditions. I have the following named ranges:

    Amount - this range contains the values I would like to sum
    Category - the category the amount is associated with
    xDate - the date an entry was made in mm/dd/yyyy format

    What I'm trying to do is sum the values in the Amount range if the Category matches what is in cell A3 and the month the entry was made matches the month in cell B1. The month in cell B1 is in text format, ie: January, February, etc.


    I originally tried this formula without success:

    =SUMIFS(Amount,Category,$A3,xDate,TEXT(xDate,"mmmm")=B$1)

    After some research I came up with this formula:

    =SUMPRODUCT(--(Category=$A3),--(TEXT(xDate,"mmmm")=B$1),Amount)

    This formula works, but there is a noticeable slowdown in the processing of the workbook with this formula. Other users will be entering data into this workbook, and there is a hang up each time you tab to a new cell.

    So, the next thing I tried was to create a helper column on the data entry table where I put the =Text(xDate,"mmmm") formula and named that range xMonth and hid the column. With that I was able to successfully use this formula without a noticeable change in processing speed:

    =SUMIFS(Amount,Campain,$A$1,Category,$A3,xMonth,B$1)

    My problem with this is that if a user clicks on a row number and does a clear contents I lose the helper formula. If I try to protect just the column that contains the formula the user would get an error saying they can't make changes.

    Any suggestions on a better approach?

    Thanks

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,082

    Re: Advice needed - SUMIFS/SUMPRODUCT Issues

    Can't you just hide the Helper column?

    Doesnt stop it from being unhidden and then changed but it's a start.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Tampa, Florida
    MS-Off Ver
    Excel 2013
    Posts
    142

    Re: Advice needed - SUMIFS/SUMPRODUCT Issues

    Yes that is what I tried. But if the user tries to clear the contents of a row by selecting the entire row by clicking on the row number it will also clears the formula even if it is hidden

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Advice needed - SUMIFS/SUMPRODUCT Issues

    If the Named Ranges refer to full columns, that will explain why the formula is slow. You would be better off with Dynamic Named Ranges, each based on a fully populated column. Or, even better off, convert your data to a Structured Table and let Excel manage the ranges for you.

    Post a sample workbook for more detail.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Tampa, Florida
    MS-Off Ver
    Excel 2013
    Posts
    142

    Re: Advice needed - SUMIFS/SUMPRODUCT Issues

    Thanks TMS. So simple yet I couldn't see the forest amongst the trees. Although I had my data entry sheet set up as a structured table I was still using named ranges, and they weren't dynamic. Using the table references fixed the slowness issue.

  6. #6
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,509

    Re: Advice needed - SUMIFS/SUMPRODUCT Issues

    You're welcome. Thanks for the rep.

+ 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. [SOLVED] SUMIFS Issues
    By wat in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-15-2015, 03:26 PM
  2. Help needed with changing SUMIFS to SUMPRODUCT
    By J.U. in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-18-2014, 04:01 AM
  3. help advice needed
    By stevencarroll19 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-30-2006, 12:00 PM
  4. [SOLVED] advice needed
    By Duncan in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-27-2005, 07:06 PM
  5. [SOLVED] advice needed
    By Duncan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-27-2005, 04:06 PM

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