Index vs Offset Performance Considerations

Uncle Ed

New Member
Joined
Sep 5, 2003
Messages
9
I'm trying to determine the best functions to use based upon performance considerations. I have been using a ton of Index w/Match and have noticed my file size of my workbook is getting quite large. I thinking of using the Offset w/Match instead in hopes that might reduce the file size.

I don't want to build my model using one method and end up with a 30MB file that takes 2 minutes to open and save if I can end up with a 5MB file using another method.

Any input on the merits of using these two functions in terms of processing speed, file size, and flexibility would be most appreciated.

:eek:
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Of course, I don't really know what you are doing, but when I see a post about an XL file 30 MB large "using a ton of Index w/Match" my instinctive reaction is that this person
  • (a) is using XL for a purpose it was not designed for,
    (b) is not fully exploiting XL's very powerful capabilities such as its ability to operate on entire ranges at one go,
    (c) is doing in XL what is better supported with VBA functions/subroutines, or
    (d) has an application that is already fine-tuned and I should keep my comments to myself.
Optimizing one function as being faster/smaller than another might -- and I emphasize might -- help at the margins. While I could be wrong, it won't lead to any dramatic improvements in performance.

You might be better off sharing what you are doing -- the business (or other scientific or whatever) intent, not the implementation -- and seeing if someone can suggest structural improvements.
 
Upvote 0
Further to Tushar's points, in general I'd expect offset to perform worse than index. Offset is volatile & recals on every sheet calculation, not only when its precedents change etc. However, as Tushar suggested, without knowing more about what you're doing it's very hard to say anything specific. (For example offset() may compare favourably to an index with 2 embedded match() functions).

More details please...
 
Upvote 0
I agree with Paddy. I have done some comparisons using an add-in called FastExcel, and it show that (with my data, anyway) INDEX is about twice as quick per cell as OFFSET. Add to that the volatility of OFFSET, and if you have a really large workbook, you may well find that INDEX is quicker.
However, Tushar also makes the good point that you may be asking too much of Excel, and possibly a database would be the way to go.

Denis
 
Upvote 0
Model Rebuild_Old2.xls
ABCDEFGHIJK
2Forecast0.70.80.9
304/01/0207/01/0210/01/02
406/30/0209/30/0212/31/02
5
6DescDateTotalCashDebtTPTDInAct2Q023Q024Q02
7PhaseI6/1/200210,0008,9001,0000.72910,000--
8PhaseII8/1/200220,00017,8002,0000.860-20,000-
9PhaseIII10/1/200230,00026,7003,0000.991--30,000
10
11DescDateTotalCashDebtTPTDInAct2Q023Q024Q02
12PhaseI6/1/200210,0008,9001,0000.729-1,000--
13PhaseII8/1/200220,00017,8002,0000.860--2,000-
14PhaseIII10/1/200230,00026,7003,0000.991---3,000
TR


Ok, here is an example: My model basically has a transaction section (top range) that details each individual transactions and TOTAL in the respective time period across the top of the sheet.

There are about 15 sections that follow the transaction section and perform different calculation (such as interest expense, depreciation, etc...) and also places these in the respective time periods. All of these results then flow into Income Statement/Cash Flow documents by Quarter so I can project out.

I calc which time period ("TP") for the transaction using the Offset and Match functions and calc the number of days from the transaction date to the end of the quarter using the Index and Match functions.

Basically what I'm wondering is since I'm doing these calculations for each of the 15 sections, will there be any perfomance considerations or flexibility considerations in using Offset/Match vs Index/Match.

I'm just getting started using VBA, so until I get more fluent, I need a straight XL solution.

Any advice is appreciated. I'm rebuiling my model and want to implement the most efficient and flexible formulas.

Super thanks in advance for any ideas. This board is awesome!!!!! :p

ue
 
Upvote 0
So, where do you have the 'ton of Index/Match' formulas?

Each of the 15 sections is how large? 5 rows by 10 columns?

Do you by any chance do a lot of inserts and deletes? What happens if you press CTRL+END? Where does XL take you? Is it really the logical last row / column of your worksheet?

How many worksheets do you have in the workbook?

Uncle Ed said:
{snip}
Ok, here is an example: My model basically has a transaction section (top range) that details each individual transactions and TOTAL in the respective time period across the top of the sheet.

There are about 15 sections that follow the transaction section and perform different calculation (such as interest expense, depreciation, etc...) and also places these in the respective time periods. All of these results then flow into Income Statement/Cash Flow documents by Quarter so I can project out.

I calc which time period ("TP") for the transaction using the Offset and Match functions and calc the number of days from the transaction date to the end of the quarter using the Index and Match functions.

Basically what I'm wondering is since I'm doing these calculations for each of the 15 sections, will there be any perfomance considerations or flexibility considerations in using Offset/Match vs Index/Match.

I'm just getting started using VBA, so until I get more fluent, I need a straight XL solution.

Any advice is appreciated. I'm rebuiling my model and want to implement the most efficient and flexible formulas.

Super thanks in advance for any ideas. This board is awesome!!!!! :p

ue
 
Upvote 0
So, where do you have the 'ton of Index/Match' formulas?
*** Currently, they are mainly in the TP and TD columns ***
Each of the 15 sections is how large? 5 rows by 10 columns?
*** Each section is about 200 rows and about 35 columns wide (incl. periods from 2002 through 2007) ***

Do you by any chance do a lot of inserts and deletes? What happens if you press CTRL+END? Where does XL take you? Is it really the logical last row / column of your worksheet?
*** I do a fair number of inserts and deletes from the first section...one issue I have is if I need to add a row to the 1st section, I must add a row to all the other sections as these all feed from the previous section (is there an easier way to handle this?) CTRL+END does take me to the logical last row/column (approx. AM2800)***

How many worksheets do you have in the workbook? "
*** Around 20 Worksheets, but this is the largest one and most of the others feed off this sheet ***

*** One other note, I'm calculating TP and TD so I don't need to calculate in each cell of the time periods for each section ***

thanks
ue
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,183
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top