+ Reply to Thread
Results 1 to 4 of 4

Index Match too slow, is there a VBA solution?

  1. #1
    Registered User
    Join Date
    08-27-2018
    Location
    USA
    MS-Off Ver
    2010
    Posts
    1

    Index Match too slow, is there a VBA solution?

    Hi!

    I made an index match array formula that looks like this:

    =IF(INDEX(Data!$D$1:$D$809659,MATCH("Status 1"&A2,Data!$B$1:$B$809659&Data!$A$1:$A$809659,0))=0,INDEX(Data!$C$1:$C$809659,MATCH("Status 1"&A2,Data!$B$1:$B$809659&Data!$A$1:$A$809659,0)),INDEX(Data!$D$1:$D$809659,MATCH("Status 1"&A2,Data!$B$1:$B$809659&Data!$A$1:$A$809659,0)))

    The problem is that I need to run that formula for ~4000 order numbers (number of formulas) and the data source it runs against is 800K rows. It takes 30+ minutes to run. Is there a VBA solution for this that would be faster, or just a faster formula?

    Attached is a sample file. It's matching two columns (order number and order status) and pulling whatever date is on that row for column D. If nothing is in column D, it pulls column C's date.

    Any ideas?

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Index Match too slow, is there a VBA solution?

    A
    B
    C
    D
    1
    Order #
    Status
    Date Match
    2
    1
    Status 1
    10/18/2014
    C2: =IF(COUNTIFS(Data!A:A, Sheet1!A2, Data!B:B, Sheet1!B2, Data!D:D, ">0"),
    SUMIFS(Data!D:D, Data!A:A, Sheet1!A2, Data!B:B, Sheet1!B2),
    SUMIFS(Data!C:C, Data!A:A, Sheet1!A2, Data!B:B, Sheet1!B2))
    3
    2
    Status 1 Format of C2: m/d/yyyy;;
    4
    3
    Status 1
    5/30/2013
    5
    4
    Status 1
    1/4/2015
    6
    5
    Status 1
    1/29/2014
    7
    6
    Status 1
    7/28/2013
    Last edited by shg; 08-27-2018 at 01:16 PM.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Index Match too slow, is there a VBA solution?

    Here's a program to put in a standard module of a macro enabled workbook:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Expert CK76's Avatar
    Join Date
    06-16-2015
    Location
    ONT, Canada
    MS-Off Ver
    MS365 Apps for enterprise
    Posts
    5,887

    Re: Index Match too slow, is there a VBA solution?

    Do it in two stages?

    1. Use advanced filter copy to extract only order numbers that has Status 1 for Order Status.
    Set up like below image (Criteria range A1:C3, Copy to $A$5:$F$5). This process should finish in few seconds or less.
    0.JPG

    2. Then perform look up on resulting data using only the Order Number as criteria.
    From your description, lookup range should be about 4000 and will complete near instantaneously.
    ?Progress isn't made by early risers. It's made by lazy men trying to find easier ways to do something.?
    ― Robert A. Heinlein

+ 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. [SOLVED] I need solution for INDEX MATCH
    By Immortal2014 in forum Excel General
    Replies: 20
    Last Post: 12-17-2015, 11:27 PM
  2. Using Sumproduct with Index and match - or is there another solution?
    By bildar in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-27-2014, 04:19 AM
  3. [SOLVED] Help with INDEX, MATCH and MAX formula - or alternative solution
    By glynnseal in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-04-2014, 08:50 AM
  4. Index, Match, and/or SumProduct solution?
    By phrankndonna in forum Excel General
    Replies: 3
    Last Post: 12-11-2012, 07:15 PM
  5. Index Match Index Formula work slow
    By avk in forum Excel General
    Replies: 9
    Last Post: 03-07-2012, 02:19 PM
  6. INDEX and MATCH too SLOW
    By dan.xls in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-22-2011, 03:59 PM
  7. Index/Match Solution?
    By WeatherGuy in forum Excel General
    Replies: 3
    Last Post: 01-31-2006, 06:20 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