• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to compare two arrays?

GN0001

Member
If we have two arrays such as
{1,2,3,4} and another array as this {4,5,6,1}

If we are going to compare these two arrays,
is this how the arrays are compared against each other?
1 is bumped against 4, 5, 6, 1
Then
2 is bumped against 4,5,6,7
Then
3 is bumped against 4,5,6,7

Please advise me if this is correct.
Thanks,
GN0001
 
Hi ,

It all depends on how the formula is written , which in turn depends on what you want to do.

Both types of comparison are possible ;

1. Where each element of Array 1 is compared with the corresponding element in Array 2 ; if all elements of Array 1 are found in Array 2 in exactly the same positions , then the two arrays are identical.

2. Where each element of Array 1 is compared with all the elements in Array 2 ; if all elements of Array 1 are found in Array 2 in some position or the other , then we can say that all elements of Array 1 are to be found in Array 2.

Narayan
 
Back
Top