+ Reply to Thread
Results 1 to 6 of 6

Way to Improve SUMPRODUCT Formula

  1. #1
    Registered User
    Join Date
    08-20-2014
    Location
    CLT
    MS-Off Ver
    2010
    Posts
    61

    Way to Improve SUMPRODUCT Formula

    Good morning,

    I am looking for assistance to see if there is a way to improve a SUMPRODUCT formula I have. The formula works as it should, but will lock my computer up when filling the formula down to all rows. My spreadsheet this is running on usually has anywhere from 35,000 to 40,000 rows. Please let me know if there are any changes that can be made to help this formula run more efficiently.

    =IF(SUMPRODUCT(($BM$3:$BM3=BM3)*($CU$3:$CU3=CU3))>1,0,1)

    I am trying to enter a 1 when values in columns BM and CU for a specific row are the first occurrence of each combination.

    Thanks.

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Way to Improve SUMPRODUCT Formula

    Not sure how much faster it would be, but looks like you could use countifs instead of sumproduct..
    And that is always preferable if it's possible..

    =IF(COUNTIFS($BM$3:$BM3,BM3,$CU$3:$CU3,CU3)>1,0,1)

  3. #3
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Way to Improve SUMPRODUCT Formula

    Try:


    =(COUNTIFS($BM$3:$BM3,BM3,$CU$3:$CU3,CU3)<=1)+0
    Quang PT

  4. #4
    Registered User
    Join Date
    08-20-2014
    Location
    CLT
    MS-Off Ver
    2010
    Posts
    61

    Re: Way to Improve SUMPRODUCT Formula

    This does seem to be significantly quicker than the SUMPRODUCT formula. Thank you very much!

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Way to Improve SUMPRODUCT Formula

    You're welcome.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Way to Improve SUMPRODUCT Formula

    Just out of interest I tested the relative speeds and the COUNTIFS version is approximately 3 times quicker.

    Depending on your data you might be able to speed that up even more. Are consecutive rows always completely different, or do values repeat often in those 2 columns? It would be much quicker if you could first check the previous row, or the last 10 or 20 rows. If there will often be a repeat row that close then that will speed up the formula considerably (if you don't find a match in the small range you then check the whole column).
    Audere est facere

+ 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. Improve IF formula
    By magic2finger in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-04-2015, 04:05 AM
  2. Improve this formula, combo of sum, Sumifs and Sumproduct
    By nickmax1 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-29-2014, 03:14 PM
  3. Improve/Shorten IF Formula
    By Saint02 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-02-2010, 09:20 PM
  4. Can anyone please improve my formula?
    By B00105904 in forum Excel General
    Replies: 11
    Last Post: 06-29-2010, 11:55 AM
  5. [SOLVED] How can improve this formula?
    By Metallo in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 01-27-2005, 02: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