+ Reply to Thread
Results 1 to 3 of 3

Large sumproduct issues in vba (error statements and improvements?)

  1. #1
    Registered User
    Join Date
    06-06-2014
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    91

    Large sumproduct issues in vba (error statements and improvements?)

    Hi all,

    Have this rather cumbersome evaluate with sumproduct that I have in vba that has two points I'd like to ask about.

    Note that AdvancedEvaluate is just some function code I found from stackoverflow which bypasses the 255 limit by copying and pasting the formula into another workbook before getting the result from there (as I said overly cumbersome).

    Please Login or Register  to view this content.
    Now as it stands I don't think I need to explain the code, I'm just showing it for reference because the questions are:

    1. How to encapsulate that in an iferror statement. I've seen one solution where it's iferror into every individual range which seems overly redundant and for this code, will make it ever slower than it already is given the huge number of conditions required (And they're all absolutely required), the number of iterations this will go through and the rows of data it has to search through (nearly 400,000 rows).
    Some later iterations will have a divide by 0 error as only some products in the range will have to be 0.

    2. Is there actually anyway in VBA to make something like a sumproduct more efficient rather than using evaluate then a ridiculously long formula over a ridiculous number of rows or is this the best it can get? Not expecting someone to rewrite my formula as of course I've not explained what I'm doing but was wondering if maybe there was a faster "substitute" for example. Everything I've read so far just says "use evaluate and sumproduct". This clearly is not an efficient idea in my case.

    If you think you need an (lengthy) explanation let me know, thanks :P

  2. #2
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,279

    Re: Large sumproduct issues in vba (error statements and improvements?)

    Attach a short example showing the data layout - 3 to 4 rows of data - with false data (to protect confidentiality, etc.).

  3. #3
    Registered User
    Join Date
    06-06-2014
    Location
    Hong Kong
    MS-Off Ver
    2010
    Posts
    91

    Re: Large sumproduct issues in vba (error statements and improvements?)

    Attached example with 50 data rows.
    Data set obviously with reduced complexity against real set.
    No need to offer a complete solution for the efficiency part of the question, unless your into that sort of thing. (I won't complain )
    Hints of where to look and how to accomplish it would be appreciated however if you think there's a way to improve it.

    Though will probably need a solid answer on the error issues, at the moment I'm using the dirty method of find/replacing the div/0 error with 0's in code after the loop is completed (maybe that's good enough?)
    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)

Similar Threads

  1. sumproduct formula improvements for matchmaking
    By Maria_sky in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-24-2020, 03:55 PM
  2. Replies: 1
    Last Post: 12-19-2018, 04:47 PM
  3. If statements and VBA improvements
    By gelen4o in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-22-2016, 09:29 AM
  4. "Large" Function w. Nested If Statements Error
    By thecartyparty1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-15-2015, 07:22 PM
  5. Performance Issues on Large Spreadsheet
    By dipique in forum Excel General
    Replies: 10
    Last Post: 06-18-2014, 09:24 AM
  6. [SOLVED] Top 5 List (LARGE and VLOOKUP Issues)
    By alexrawnsley in forum Excel General
    Replies: 3
    Last Post: 07-02-2012, 02:30 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