+ Reply to Thread
Results 1 to 6 of 6

Is INDEX & MATCH formula Inefficient?

  1. #1
    Registered User
    Join Date
    09-16-2010
    Location
    Glasgow
    MS-Off Ver
    2010
    Posts
    68

    Is INDEX & MATCH formula Inefficient?

    I have created the following formula in column L of my spreadsheet:

    Please Login or Register  to view this content.
    Basically the formula does the following:
    1) concatenate the 'Country', 'Parent Chassis S/N', 'Service Start Date' columns and adds CHASSIS to the string
    2) find this value in column P (which is a helper column I created; the formula in this column concatenates the 'Country', 'Parent Chassis S/N', 'Service Start Date' and 'Device Type' columns)
    3) If a match exists, return the associated value from column O into column L, otherwise return the minimum value between column I, J and K.

    The goal of this formula is for every module associated to a chassis [i.e. modules (in column B) having the same parent chassis S/N (in column A)] to have their Effective End Date never 'higher' than the one from their associated chassis.

    The formula works fine, but it does not seem to be very efficient, specially since the complete spreadsheet contains around 30,000 rows.

    Is there a way to create my formula more efficiently?
    Is there a way to get rid of those helper columns (i.e. O and P) I created?

    Thanks a lot,
    Ant
    Attached Files Attached Files

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

    Re: Inefficient INDEX & MATCH formula

    I'd say that's about as efficient as it can get.

    My only suggestion would be to not use entire column references like O:O and P:P
    Instead, use finite row #s like O$1:O$30000


    Also, this may just because you've simplified your book for our benefit...

    But it seems the values in Column O that you're indexing are the result of the same MIN function you use in IFERROR if the INDEX is an error.
    So why bother using the INDEX to begin with?
    Why not just use the MIN value and forget about the index/match.

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Inefficient INDEX & MATCH formula

    Yes, there are OTHER ways to accomplish what you've done without the helper column. But without your helper column you would be creating an array in EVERY cell of column L, an array if 30k options, so that would be extraordinarily less efficient than what you have already.

    I would do exactly what you've done, then possibly hide the helper column. Maybe not hide it.


    When using whole columns in an INDEX/MATCH, there is no loss of efficiency like there are with other functions. It's an awesomely robust function.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Inefficient INDEX & MATCH formula

    Another thing to bear in mind is do you need those formulae to be active once they have calculated? If the data is essentially static, then once your have applied the formulae you could think about fixing the values so then you wouldn't need the helper columns - just re-apply the formulae for any new data added, then fix those values.

    Hope this helps.

    Pete

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Is INDEX & MATCH formula Inefficient?

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

  6. #6
    Registered User
    Join Date
    09-16-2010
    Location
    Glasgow
    MS-Off Ver
    2010
    Posts
    68

    Re: Is INDEX & MATCH formula Inefficient?

    Hi Jonmo1,

    To reply to your comments:

    But it seems the values in Column O that you're indexing are the result of the same MIN function you use in IFERROR if the INDEX is an error. So why bother using the INDEX to begin with? Why not just use the MIN value and forget about the index/match.
    The formula retrieve the lowest date between columns I, J and K for the associated chassis and applies to its modules in column L, unless this chassis 'lowest' date is 'bigger than the module 'lowest' date (in this case the formula is simply using the module 'lowest' date). Not sure if this makes sense but I think it works pretty well.


    Hi Jerry,

    When using whole columns in an INDEX/MATCH, there is no loss of efficiency like there are with other functions.
    Thanks for the tip, I was reluctant to use a finite range and named range as the end users won't be able to change those formulas, glad to know using the whole columns is not much of a problem.


    Hi Pete,

    I do need the formulas to be active as the values can change very often, also the end users will not be able / do not have the skills to do any changes.


    To all, I think the efficiency issue might be related to another function we created. It works fine but it increases the size of the file by 2 (when compared to using static values). This is very strange... we are still investigating, might open a separate thread if we cannot come to any conclusions. Thanks all for your help, I will close this thread.

+ 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. Replies: 6
    Last Post: 11-08-2013, 10:29 PM
  2. Replies: 3
    Last Post: 05-02-2013, 01:31 AM
  3. Index Match Index Formula work slow
    By avk in forum Excel General
    Replies: 9
    Last Post: 03-07-2012, 02:19 PM
  4. Replies: 5
    Last Post: 02-29-2012, 08:51 PM
  5. Nested Match(index()) vs. Match() array formula.
    By GeneralDisarray in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2011, 07:57 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