+ Reply to Thread
Results 1 to 2 of 2

Can anyone optimize the code? (to make it work faster)

  1. #1
    Registered User
    Join Date
    07-23-2007
    Posts
    1

    Can anyone optimize the code? (to make it work faster)

    112x320 x6 worksheets have:

    =IF(ISNA(VLOOKUP($A6,OFFSET([PVR.xls]Prices!$A$1,0,MATCH(DH$1,[PVR.xls]Prices!$A$1:$IA$1,0)-1,544,2),2,0)),INDEX(DH:DH,ROW()-1),VLOOKUP($A6,OFFSET([PVR.xls]Prices!$A$1,0,MATCH(DH$1,[PVR.xls]Prices!$A$1:$IA$1,0)-1,544,2),2,0))

    Breakdown:

    VLOOKUP($A6,OFFSET([test.xls]Prices!$A$1,0,MATCH(DH$1,[test.xls]Prices!$A$1:$IA$1,0)-1,544,2),2,0)) - match by Column A and by Row 1 from another table

    -about 26 megs .xls file, any way of reducing the size/faster calculation of this? (112 columns by 320 rows)


    Thank You!

  2. #2
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi,

    My first suggestion would be to create a new "helper' column (eg DI?) which you enter the vlookup section into & then refer to this column in the isna formula ie:
    DI6 = VLOOKUP($A6,OFFSET([PVR.xls]Prices!$A$1,0,MATCH(DH$1,[PVR.xls]Prices!$A$1:$IA$1,0)-1,544,2),2,0))

    and then DJ6 = if(isna(DI6), INDEX(DH:DH,ROW()-1), DI6)
    This has effectively halved the amount of calculations done by the file.

    Another suggestion is to ensure that any lookup ranges are limited to just the used range eg change "DH:DH" to the actual cells used.


    Other ways of improving performance are suggested at the various pages of Charles Williams' which are linked on the below link:
    HTML Code: 
    hth,
    Rob
    Rob Brockett
    Kiwi in the UK
    Always learning & the best way to learn is to experience...

+ 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