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: 2,452
Default fast and simple way to match up arrays

What would be a fast and simple way to match up 2-D arrays with a 1-D array?
The main thing is speed, far less important is simplicity.

These 2-D arrays come from ADO Recordsets.
The matching up will happen on the numbers in the 1-D array and the numbers
in the
first column of the 2-D arrays. All these numbers are integer numbers.
The 1-D array holds all the ID numbers and the 2-array a subset of these ID
numbers.
Both arrays are sorted ascending on these ID numbers.
So for example:

array1
1
2
3
4
5
6

array2
2, Apple
3, Pear
4, Orange

resulting array:
1,
2, Apple
3, Pear
4, Orange
5,
6,

Now I have made a Sub that does this and I think it is quite fast (matching
up 2 arrays of
about 25000 rows in about 70 milliseconds) but it is a bit complex.
I have tried a completely different method involving running SQL on text
files. This is very
much simpler, but much slower.
My first attempt was with the Matchup function, but that is even slower.

I am probably not going to improve on my current method, but just wonder if
anybody had any
bright ideas about this problem.
Thanks for any advice.


RBS

 
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
MATCH Function - 2 Dimension Arrays AZ_Ray Excel Worksheet Functions 3 September 11th 08 10:59 PM
SIMPLE QUESTION need fast answer please Jannie Excel Worksheet Functions 6 October 5th 07 06:22 PM
MATCH being sent two arrays Richard Fangnail Excel Worksheet Functions 2 August 17th 07 02:03 AM
MATCH, INDEX and VLOOKUP with Arrays Dean Hinson[_3_] Excel Programming 2 March 18th 05 03:20 PM
Simple arrays with If statements Andy Excel Programming 4 September 23rd 03 06:15 PM


All times are GMT +1. The time now is 08:35 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"