Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 102
Default Comparing to Arrays

I'll answer 2 first - I'm on xl2000

As for the first item - the two arrays that I'm trying to compare - my
array5 and my array6 are of 20,000-30,000 elmenets in array6 and
30,000-40,000 elements in array5. To make sure that it was even moving
- I set up an Application.StatusBar line that would show me increments
of 1% complete. After about 30 minutes, it was about 8-10% complete. I
ended up letting it run over night and it did complete, but I'm willing
to bet based on scaling up what I was willing to watch that it took 5
hours.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Comparing to Arrays

wrote:

I'll answer 2 first - I'm on xl2000

As for the first item - the two arrays that I'm trying to compare - my
array5 and my array6 are of 20,000-30,000 elmenets in array6 and
30,000-40,000 elements in array5. To make sure that it was even moving
- I set up an Application.StatusBar line that would show me increments
of 1% complete. After about 30 minutes, it was about 8-10% complete. I
ended up letting it run over night and it did complete, but I'm willing
to bet based on scaling up what I was willing to watch that it took 5
hours.


In xl2000 the following ran in a little over 2 minutes on my machine. It
requires the availability to your workbook of the ArrayTranspose
function from the freelydownloadable file at
http://home.pacbell.net/beban. I don't have a later version of Excel,
but I suspect the time can be further reduced in them by use of
something like the commented out lines (with a little additional code to
collect the x data), which then doesn't require the add-in function,
instead of the four operative lines between the commented out stuff.

Sub Test12345()
Dim arr1(1 To 25000)
Dim arr2(1 To 25000)
For i = 1 To 25000
arr1(i) = i
arr2(i) = 3 * i
Next
starttime = Now()
'Range("A1:A5460").Value = Application.Transpose(arr1)
'Range("B1:B5460").Value = Application.Transpose(arr2)
Range("A1:A25000").Value = ArrayTranspose(arr1)
Range("B1:B25000").Value = ArrayTranspose(arr2)
Range("C1").Formula = "=COUNTIF(b$1:b$25000,a1)"
Range("C1").AutoFill Destination:=Range("C1:C25000")
'For Each Elem In arr1
'x = Application.Match(Elem, arr2, 0)
'Next
Debug.Print (Now() - starttime) * 86400
arr3 = Range("c1:c25000")
End Sub

Alan Beban
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
Comparing 2 arrays [email protected] Excel Worksheet Functions 3 January 2nd 06 02:31 AM
Comparing Arrays TangentMemory Excel Discussion (Misc queries) 2 May 13th 05 05:06 PM
Comparing Arrays KL Excel Worksheet Functions 9 December 3rd 04 08:58 PM
Comparing to Arrays Marston Excel Programming 7 September 1st 04 01:09 AM
Comparing to Arrays [email protected] Excel Programming 0 August 31st 04 07:50 PM


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