+ Reply to Thread
Results 1 to 3 of 3

INDEX with multiple MATCH's used with IF's taking a really long time to calculate

  1. #1
    Registered User
    Join Date
    10-23-2014
    Location
    Charleston, SC
    MS-Off Ver
    2010
    Posts
    10

    INDEX with multiple MATCH's used with IF's taking a really long time to calculate

    I'm trying to find a way to speed up this calculation.

    =IF(ISERROR(INDEX('Current BOM''s'!E:E,MATCH(1,('Current BOM''s'!C:C=E13)*('Current BOM''s'!D:D="TOTAL"),0),1)),VLOOKUP(E13,'Current BOM''s'!C:E,3,FALSE),IF(ISBLANK(E13),"",INDEX('Current BOM''s'!E:E,MATCH(1,('Current BOM''s'!C:C=E13)*('Current BOM''s'!D:D="TOTAL"),0),1)))

    It works for all my conditions, but it takes a bit. The INDEX part of the function I came up with is what is confusing the most to me. From the examples I looked up, it would be the column where the data I'm trying to return is stored...I'm just not sure that's correct.

    E13 is the number I'm looking for on the Current BOM's worksheet, for instance 7719218976. I'm putting my formula in cell G13.

    If E13 is blank then the cell value should be "". The Current BOM's worksheet could have multiple occurrences of the value in E13 in column C. It looks for E13 in column C, then looks for the row where column D = "TOTAL", and returns the value for column E. If it can't find a match where TOTAL is in column D, then it just runs a VLOOKUP on E13 and still returns column E. The reason I'm having to do this is because some numbers I'm looking up are components and others are assemblies where the value I need is a total.

    Another way to say what I'm trying to do is:

    I want to search for E13 in column C of worksheet "Current BOM's". I'm wanting to return the value of column E. However, if there are multiple occurrences of E13, I want the one where column D = "TOTAL". If E13 is blank, I want the value to show as "".

    Sometimes it's easier for me to say what I'm trying to make the formula do that to write it.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,938

    Re: INDEX with multiple MATCH's used with IF's taking a really long time to calculate

    1st, you can probably shorten that using IFERROR, IF the omission of the VLOOKUP() in the 2nd part is an error?
    =IF(ISERROR(INDEX('Current BOM''s'!E:E,MATCH(1,('Current BOM''s'!C:C=E13)*('Current BOM''s'!D:D="TOTAL"),0),1)),VLOOKUP(E13,'Current BOM''s'!C:E,3,FALSE),IF(ISBLANK(E13),"",
    INDEX('Current BOM''s'!E:E,MATCH(1,('Current BOM''s'!C:C=E13)*('Current BOM''s'!D:D="TOTAL"),0),1)))

    to this...
    =IFERROR(INDEX('Current BOM''s'!E:E,MATCH(1,('Current BOM''s'!C:C=E13)*('Current BOM''s'!D:D="TOTAL"),0),1)),VLOOKUP(E13,'Current BOM''s'!C:E,3,FALSE),IF(ISBLANK(E13),"",)


    2nd, that is an array formula, dont use entire columns, and you may even be able to use a regular formula if you use helper column to combine the criteria and base the match on thatr
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  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: INDEX with multiple MATCH's used with IF's taking a really long time to calculate

    And sometimes it's far faster for us to offer a solution by showing us the scenario in a sample workbook with a small amount of data, just enough to demonstrate what your data looks like and then a manual mockup of the results you're after.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    _________________
    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!)

+ 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. INDEX/MATCH formula taking too long
    By Rob Ardill in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-09-2014, 11:01 PM
  2. Arrey formula taking long time to calculate - any other way or MACRO can be built ??
    By kedarlimaye87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2013, 08:44 AM
  3. Array Formulas taking too long to calculate
    By CheeksExcelForum in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-17-2013, 06:56 PM
  4. Optimizing Formulas - taking too long to calculate large worksheet
    By lightsandsirens in forum Excel General
    Replies: 0
    Last Post: 08-21-2012, 10:38 AM
  5. Macro taking too long time to run
    By sharmanjali87 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-02-2010, 07:08 AM

Tags for this Thread

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