#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JavyD
 
Posts: n/a
Default Slow Calculation

hello Everyone,

This small formula over 300 rows and 16 columns takes about 20 mins, can I
minimize that?

=IF(ISERROR(VLOOKUP($A7,'CHE all sku'!$A:$Z,'MTL
aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE all sku'!$A:$Z,'MTL
aux'!B7,FALSE))-IF(ISERROR(VLOOKUP($A7,'CHE MBE sku'!$A:$Z,'MTL
aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE MBE sku'!$A:$Z,'MTL
aux'!B7,FALSE))-IF(ISERROR(VLOOKUP($A7,'CHE MEX sku'!$A:$Z,'MTL
aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE MEX sku'!$A:$Z,'MTL aux'!B7,FALSE))
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Miguel Zapico
 
Posts: n/a
Default Slow Calculation

If you know the maximum number of rows, I would recommend not to use the full
columns in the VLOOKUP ranges ($A:$Z), but use a fixed range instead
($A$1:$Z$5000, for example). Even better, create names for those ranges and
use the names instead.
One other thing that you may try is using the MATCH formula in the IF part
of the formula, if possible also on a limited range. For example of the
first part of the formula could look like:
=IF(ISERROR(MATCH($A7,all_codes,0)),0,VLOOKUP($A7, all_data,'MTL
aux'!B7,FALSE))
where "all_codes" is the range 'CHE all sku'!$A$1:$A$5000, and "all data" is
'CHE all sku'!$A$1:$Z$5000.

Hope this helps,
Miguel.

"JavyD" wrote:

hello Everyone,

This small formula over 300 rows and 16 columns takes about 20 mins, can I
minimize that?

=IF(ISERROR(VLOOKUP($A7,'CHE all sku'!$A:$Z,'MTL
aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE all sku'!$A:$Z,'MTL
aux'!B7,FALSE))-IF(ISERROR(VLOOKUP($A7,'CHE MBE sku'!$A:$Z,'MTL
aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE MBE sku'!$A:$Z,'MTL
aux'!B7,FALSE))-IF(ISERROR(VLOOKUP($A7,'CHE MEX sku'!$A:$Z,'MTL
aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE MEX sku'!$A:$Z,'MTL aux'!B7,FALSE))

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Niek Otten
 
Posts: n/a
Default Slow Calculation

Good advice from Miguel!

In addition: you can halve the number of VLOOKUPs by adding an extra cell, in which you do the VLOOKUP; in the next cell you test
it for ISNA, and return 0 or the result of the VLOOKUP.
Next point: 4th argument FALSE is very, very slow, because the table has to be searched from top to bottom sequentially.
Of course shortening the range, as Miguel suggested, may help a lot. If it still is too slow: can you sort your data? If so, you
can use True as 4th argument (or omit it) and check yourself that the key returned is the right one.
Fastest of all:
Sort the data, use MATCH to locate the row (4th argument = 1), ISNA() to check for presence, INDEX() to pick out the right item.

--
Kind regards,

Niek Otten

"Miguel Zapico" wrote in message
...
| If you know the maximum number of rows, I would recommend not to use the full
| columns in the VLOOKUP ranges ($A:$Z), but use a fixed range instead
| ($A$1:$Z$5000, for example). Even better, create names for those ranges and
| use the names instead.
| One other thing that you may try is using the MATCH formula in the IF part
| of the formula, if possible also on a limited range. For example of the
| first part of the formula could look like:
| =IF(ISERROR(MATCH($A7,all_codes,0)),0,VLOOKUP($A7, all_data,'MTL
| aux'!B7,FALSE))
| where "all_codes" is the range 'CHE all sku'!$A$1:$A$5000, and "all data" is
| 'CHE all sku'!$A$1:$Z$5000.
|
| Hope this helps,
| Miguel.
|
| "JavyD" wrote:
|
| hello Everyone,
|
| This small formula over 300 rows and 16 columns takes about 20 mins, can I
| minimize that?
|
| =IF(ISERROR(VLOOKUP($A7,'CHE all sku'!$A:$Z,'MTL
| aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE all sku'!$A:$Z,'MTL
| aux'!B7,FALSE))-IF(ISERROR(VLOOKUP($A7,'CHE MBE sku'!$A:$Z,'MTL
| aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE MBE sku'!$A:$Z,'MTL
| aux'!B7,FALSE))-IF(ISERROR(VLOOKUP($A7,'CHE MEX sku'!$A:$Z,'MTL
| aux'!B7,FALSE)),0,VLOOKUP($A7,'CHE MEX sku'!$A:$Z,'MTL aux'!B7,FALSE))


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow Calculation speeds in big spreadsheet MichaelC Excel Worksheet Functions 1 March 16th 06 08:47 PM
Does this slow down calculation? sfrancoe Excel Discussion (Misc queries) 1 January 15th 06 03:39 PM
Calculation Setting in Excel Stuart Bisset Excel Discussion (Misc queries) 0 June 17th 05 09:54 AM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 10:11 PM
How do I use a rounded calculation result in another calculation? vnsrod2000 Excel Worksheet Functions 1 January 26th 05 09:36 PM


All times are GMT +1. The time now is 05:22 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"