LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default optimizing a lookup

I have a large vector (about 10 000 elements) and I want to make a lookup to
find a value and to put it into a grid.
My problem is that I have to make these lookups many times
(24h*60min*20=28800) into 10 000 elements vector
My data looks like this:

Station Time Stn_Time Vehicle
A 0:01 A_0:01 1
A 0:02 A_0:02 2
C 0:03 C_0:03 3
D 0:04 D_0:04 4
E 0:05 E_0:05 5
F 0:06 F_0:06 6

(tbl. 1)

i.e. for each STN and each minute I have a Vehicle. I want to present this
in a grid, where the left column contains stations and the header row
contains minutes, and in the grid inside - Vehicles:
0:01 0:02 0:03 0:04 0:05 0:06
A 1 2
B
C


(tbl.2)

To get this representation, I use VLookup function in the above grid:
=IF(ISNA(VLOOKUP($A2&"_"&B1,Sheet2!$C$2:$D$7,2,FAL SE)),"",VLOOKUP($A2&"_"&B1
,Sheet2!$C$2:$D$7,2,FALSE))
It works fine, except that it is extremely slow, because VLOOKUP function is
called around 28800 times and it looks every time into my array of 10000
elements. And it takes more than 7 minutes!!!

Is there any better way to acieve that simple task?
(I am sure it is, but I don't know it) :-(

Any suggestions are welcome

Yakimo




 
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
Help Optimizing a Sheet to improve performance Vulcan Excel Worksheet Functions 2 June 14th 08 02:56 AM
Optimizing mortage payback Hannes Excel Worksheet Functions 0 September 14th 05 09:01 AM
MapPoint Optimizing mak Excel Discussion (Misc queries) 0 August 17th 05 09:30 PM
Optimizing an investment portfolio Thomas T. Halikias Excel Programming 0 May 11th 04 02:53 AM
Optimizing in VB Phil Excel Programming 1 August 8th 03 05:18 PM


All times are GMT +1. The time now is 09:36 AM.

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

About Us

"It's about Microsoft Excel"