Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Help with Array compare

I have 2 arrays from which I want to create a 3d. I need to compare the
TotArray with the UsedArray and put the difference into AvailableArray. For
example

TotArray
Ford
Chevy
Datsun
Nisan
Toyota

UsedArray
Ford
Chevy
Datsun

AvailableArray
Nisan
Toyota

I can't seem to get the


  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Help with Array compare

This might work..

dim x as integer
dim Add as boolean
dim availarray(1)
x = 1
for i = 1 to ubound(totarray)
add = true
for j = 1 to ubound(usedarray)
if totarray(i) = usedarray(j) then
Add = false
next j
if add = true then
redim availarray(x)
availarray(x) = totarray(i)
x = x + 1
end if
next i


-----Original Message-----
I have 2 arrays from which I want to create a 3d. I need

to compare the
TotArray with the UsedArray and put the difference into

AvailableArray. For
example

TotArray
Ford
Chevy
Datsun
Nisan
Toyota

UsedArray
Ford
Chevy
Datsun

AvailableArray
Nisan
Toyota

I can't seem to get the


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Help with Array compare


Will UsedArray always be the same up to a point as TotArray? As in, wil
the difference always be because one is longer than the other?

Do you only want to compare the items with the same index number or d
you want to know if the value is matched anywhere at all in the othe
array?

Are the arrays organized in some useful way?

Is it possiblethat you would have dupliate entries in one array and i
so, assuming the value is found only once in the other array, shoul
the value be added to your new array?

Would I be correct in assuming that the UsedArray only contains value
from the TotArray?

Thanks - piku

--
piku

I have two kids. :-
-----------------------------------------------------------------------
pikus's Profile: http://www.excelforum.com/member.php...nfo&userid=355
View this thread: http://www.excelforum.com/showthread.php?threadid=26422

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Help with Array compare

The UsedArray is always a subset of the TotArray
The difference between TotArray and UsedArray will always go into AvailArray
There are never duplicates in any of the arrays
The TotArray is organized by number in ascending order
( the original example shows cars, but the actual data is a text field
of numbers) - never more than 8
TotArray
411310
411320
411330
411340
411350
411360

The items in the UsedArray may not be contiguous - for example
UsedArray
411320
411340
411360

GMet

"pikus" wrote in message
...

Will UsedArray always be the same up to a point as TotArray? As in, will
the difference always be because one is longer than the other?

Do you only want to compare the items with the same index number or do
you want to know if the value is matched anywhere at all in the other
array?

Are the arrays organized in some useful way?

Is it possiblethat you would have dupliate entries in one array and if
so, assuming the value is found only once in the other array, should
the value be added to your new array?

Would I be correct in assuming that the UsedArray only contains values
from the TotArray?

Thanks - pikus


--
pikus

I have two kids. :-)
------------------------------------------------------------------------
pikus's Profile:

http://www.excelforum.com/member.php...fo&userid=3550
View this thread: http://www.excelforum.com/showthread...hreadid=264223



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
Compare an Array to a Date Range Mashuganah Excel Discussion (Misc queries) 9 April 2nd 10 07:35 PM
Simple array compare not working PeteJ Excel Discussion (Misc queries) 7 March 13th 08 08:55 PM
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
Compare row contents w/Sumproduct or Array formula? uw805 Excel Worksheet Functions 5 June 6th 06 07:09 AM
How do I compare cells and if FALSE compare to next cell in EXCEL Cindie Excel Worksheet Functions 0 March 24th 06 05:29 PM


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