+ Reply to Thread
Results 1 to 5 of 5

Excel 2007 : performance issue with a lookup function

  1. #1
    Registered User
    Join Date
    04-20-2011
    Location
    nashville, tennessee
    MS-Off Ver
    Excel 2007
    Posts
    33

    performance issue with a lookup function

    Posted a problem last week that Marcol solved with results exceeding expectations.. My problem now is that I gave him test data that was 1% of the real data I'm sorting through.

    When I use the lookup function he created:

    =LOOKUP(REPT("Z",255),CHOOSE({1;2},"",INDEX($A$2:$A$21871,MATCH(TRUE,INDEX(ISNA(MATCH($A$2:$A$21871,$B$1:$B313,0)),0),0))))

    and I apply it to the 21,871 lines I'm actually working with it takes 30 minutes for it to finish... Are there any alternatives (code wise) to this that would speed it up or are there other measures (hardware) I can take to speed this up?

    thanks,
    Bud
    Last edited by budchevy; 05-17-2011 at 05:28 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: performance issue with a lookup function

    Try using a helper column with formula:

    =ISNA(MATCH($A$2, $B$1:$B313,0))

    copied down.

    then

    =IFERROR(INDEX($A$2:$A$21871,MATCH(TRUE,$C$2:$C$21871,0)),"")

    where C2:C2187 is the helper column range....
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    04-20-2011
    Location
    nashville, tennessee
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: performance issue with a lookup function

    I'm not sure I get what you mean.. When I add the helper into column c and drag down I get all true. Where do I add the second formula?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: performance issue with a lookup function

    In your original formula it seems that you are looking in column A and finding when a value in column A is not in the list identified in B1:B313. The first time it finds that a value in column A is not in B1:B13, then the INDEX returns that item from column A that did not match.

    Well, put this in a free column at row 2, like, say C2: =ISNA(MATCH($A$2, $B$1:$B313,0))

    and copied down will check each cell in column A individually to see if there is a match in B1:B313.... you should get TRUE if there is not a match in B1:B13 and FALSE if there is a match.

    The second formula: =IFERROR(INDEX($A$2:$A$21871,MATCH(TRUE,$C$2:$C$21871,0)),"") is a single cell formula that should give same result as the original formula. It assumes you put the ISNA(MATCH()) formula in column C and copied down.

    If this is not giving the intended results, then you need to describe the problem/requirement from scratch.

  5. #5
    Registered User
    Join Date
    04-20-2011
    Location
    nashville, tennessee
    MS-Off Ver
    Excel 2007
    Posts
    33

    Re: performance issue with a lookup function

    Thanks again for all your help, I think I found a way around the lookup issue.. I just used the remove dupes function that excel has and cleaned up column A. It allowed me to remove the lookup funtion all together..
    Trying to make a problem harder than it should be..

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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