+ Reply to Thread
Results 1 to 2 of 2

Need help optimizing formula that returns row number

  1. #1
    Forum Contributor
    Join Date
    10-30-2010
    Location
    Kansas, USA
    MS-Off Ver
    Excel 2010
    Posts
    100

    Need help optimizing formula that returns row number

    I'm trying to optimize a spreadsheet that currently utilizes a slow array formula that calculates the number of rows it takes to make total purchased quantity greater than cumulative consumption and then it returns the row number, the kicker too is it matches to a unique sku. The current array formula starts in cell Q16 and works wonderfully but it is to slooow when there are a lot of rows of data.

    I will attach the spreadsheet.

    The array formula is in Q16.

    I am open to anything that improves this spreadsheets performance whether it be code or helper columns etc. I need to be able to input lots of data.

    Any help is appreciated
    Thanks in advance
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Need help optimizing formula that returns row number

    Well, the mmult is probably the biggest killer, as I imagine that is rarely limited to just 25 rows.

    Seems like the best way to speed it up is to avoid the mmult, and with that I think you need a helper sheet. The top row would be the SKUs. Under it would be the cumulative sum of parts for that SKU (i.e. recreating the results of your mmult). The good news is that this could be a simple sumif. As a quick example (but I would recommend creating a sheet like this), if cell G40 has "B" in it, then in G41 you type in:
    =SUMIF($D$14:D14,$G$40,$E$14:E14)

    Drag that down, and you have the results of the mmult for that sku. You can change the B to an A and it will adjust. But, when you create a table like this (on a separate sheet) then you can change your formula to use some MATCH/INDEX lookups to get the value.

    Not as dynamic as your method as you will need to add new SKUs to this sheet (or use some other Excel tricks to automatically add them).
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

+ 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. formula that returns a number based on a certain criteria
    By Alexmedft in forum Excel General
    Replies: 4
    Last Post: 07-14-2017, 11:38 AM
  2. Formula that returns row number and column number
    By jason44 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-21-2015, 11:01 AM
  3. [SOLVED] Array formula that returns the number of the row with the greatest sum
    By Yangado in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-30-2015, 01:30 PM
  4. Any idea why this formula returns a 4 digit number?
    By ks100 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-30-2013, 01:17 PM
  5. Formula that counts cells and returns a number
    By blburden in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-20-2012, 10:43 PM
  6. Replies: 31
    Last Post: 09-28-2011, 02:13 PM
  7. Formula returns odd decimal number
    By endoskeleton in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-03-2011, 04:30 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